Click here to Skip to main content
15,901,373 members
Home / Discussions / C#
   

C#

 
GeneralRe: Global Assembly Cache versus COM Pin
Ryan Minor30-Jan-10 2:26
Ryan Minor30-Jan-10 2:26 
GeneralRe: Global Assembly Cache versus COM Pin
Not Active30-Jan-10 3:48
mentorNot Active30-Jan-10 3:48 
GeneralRe: Global Assembly Cache versus COM Pin
#realJSOP30-Jan-10 2:25
professional#realJSOP30-Jan-10 2:25 
GeneralRe: Global Assembly Cache versus COM Pin
Ryan Minor30-Jan-10 5:06
Ryan Minor30-Jan-10 5:06 
GeneralRe: Global Assembly Cache versus COM [modified] Pin
#realJSOP30-Jan-10 5:45
professional#realJSOP30-Jan-10 5:45 
GeneralRe: Global Assembly Cache versus COM Pin
Ryan Minor30-Jan-10 7:36
Ryan Minor30-Jan-10 7:36 
GeneralRe: Global Assembly Cache versus COM [modified] Pin
#realJSOP30-Jan-10 8:04
professional#realJSOP30-Jan-10 8:04 
Question#if indentation [modified] Pin
F2dk29-Jan-10 9:48
F2dk29-Jan-10 9:48 
Hello everyone!

To illustrate my question, here is a minimal amount of code showing off the problem:
#define TEST

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1 {
  class Program {
    static void Main(string[] args) {
      if (true) {
        DoSomething();
      }
#if TEST
 else {

      }
#endif
    }

    private static void DoSomething() {
      throw new NotImplementedException();
    }
  }
}


I have kept the indentation that Microsoft Visual C# provides.

Look at the else-block. Its indentation is wrong. It should be indented to the same position as if (true).

My guess is that MSVC# thinks that the else belongs to the compiler directive #if.

Is there any way to make MSVC# indent the else-line correctly? (I'd prefer not to do it manually since I use the in-built Reformat Document function.)

I am using Visual C# 2008 SP1 by the way.


Thanks in advance,
F2

modified on Friday, January 29, 2010 4:31 PM

AnswerRe: #if indentation Pin
Not Active29-Jan-10 10:26
mentorNot Active29-Jan-10 10:26 
GeneralRe: #if indentation Pin
F2dk29-Jan-10 10:36
F2dk29-Jan-10 10:36 
GeneralRe: #if indentation Pin
Not Active29-Jan-10 11:02
mentorNot Active29-Jan-10 11:02 
AnswerRe: #if indentation Pin
OriginalGriff29-Jan-10 10:31
mveOriginalGriff29-Jan-10 10:31 
GeneralRe: #if indentation Pin
F2dk29-Jan-10 10:33
F2dk29-Jan-10 10:33 
GeneralRe: #if indentation Pin
OriginalGriff29-Jan-10 10:52
mveOriginalGriff29-Jan-10 10:52 
GeneralRe: #if indentation Pin
F2dk29-Jan-10 10:57
F2dk29-Jan-10 10:57 
GeneralRe: #if indentation Pin
Not Active29-Jan-10 11:04
mentorNot Active29-Jan-10 11:04 
GeneralRe: #if indentation Pin
F2dk29-Jan-10 11:32
F2dk29-Jan-10 11:32 
GeneralRe: #if indentation Pin
PIEBALDconsult29-Jan-10 12:20
mvePIEBALDconsult29-Jan-10 12:20 
GeneralRe: #if indentation Pin
Luc Pattyn29-Jan-10 12:49
sitebuilderLuc Pattyn29-Jan-10 12:49 
GeneralRe: #if indentation Pin
Not Active29-Jan-10 13:17
mentorNot Active29-Jan-10 13:17 
JokeRe: #if indentation Pin
DaveyM6929-Jan-10 13:45
professionalDaveyM6929-Jan-10 13:45 
GeneralRe: #if indentation Pin
#realJSOP30-Jan-10 8:08
professional#realJSOP30-Jan-10 8:08 
GeneralRe: #if indentation Pin
Not Active29-Jan-10 13:05
mentorNot Active29-Jan-10 13:05 
JokeRe: #if indentation Pin
F2dk29-Jan-10 20:46
F2dk29-Jan-10 20:46 
GeneralRe: #if indentation Pin
#realJSOP30-Jan-10 8:25
professional#realJSOP30-Jan-10 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.