>>>Hi everybody,
>>>
>>>In the sample project I downloade and unable to run I see that sections are organized by regions. I'm wondering is it something VS inserts automatically (if yes, how) or it's VS2008 feature?
>>>
>>>I don't think I saw them in the projects I'm working on except for auto-generated code.
>>>
>>>Thanks a lot in advance.
>>
>>Nadya,
>>
>>Regions start with
>>
>>#region SomeName
>>
>>and are terminated by
>>
>>#endregion
>>
>>
>>This enables the developer to expand/collapse a region like you are able to expand/collapse every class, method
>>
>>Some people have a region for the methods and one for the properties
>>
>>something like
>>
>>public class human
>>{
>>#region attributes
>> public string name;
>> public string firstname;
>> public Int32 age;
>>#endregion
>>
>> ... etc
>>
>>}
>>
>>
>>____
>>Update: regions can be nested
>
>I understood that but I was thinking what exactly organizes it. Is it something the developer has to do manually or there is IDE trick to keep all the relevant code pieces together? E.g. I currently have grid and button's code all mixed in the source file. What should I do to make all grid's code together and all button's code together, etc. ?
As far as I know Naomi you have to cut and paste. I just keep my organization in mind early on. I set up my regions before I add too much code then as I add methods, I put them in the region I want. If you double click a control and auto create the handler method, then I just cut it and paste it in where I want it. It is kinda like art, everybody sees the organization differently.
Tim
Timothy Bryan