visual studio - Why is #region a directive and not a comment? -


i assume #region ignored , dropped compiler, why preprocessor directive rather kind of comment structure (like //region name: stuff(); //endregion name or something.) there particular reason decision make directive made?

i know it's not direct answer that's how it's laid out in c# language spec (ยง2.5).

the pre-processing directives provide ability conditionally skip sections of source files, report error , warning conditions, , delineate distinct regions of source code.

i don't think it's ignored compiler, doesn't have effect. it's still considered conditional compilation lexical processing point of view and, therefore, in line of other pre-processing directives. spec:

the lexical processing of region:

#region

...

#endregion

corresponds lexical processing of conditional compilation directive of form:

#if true

...

#endif


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -