Key Class Naming and Visibility Issues

I always see people give me code (I mean code examples for questions about SO, etc.) like:

    class MyData{
       ObservableCollection<Color> Colors;
       ObservableCollection<Fruit> Fruits;
       ObservableCollection<Pairs> Pairs;

       public void MatchCurrentSelection(){
            .....
etc
            }
       }
    } 

Every time I start writing code in visual studio, it forces me to declare visibility and always be included in the namespace. Don't people leave the namespace as their own inappropriate? And why am I always forced to establish visibility? (By default, it is automatically added by default)

    namespace TheProject
    {
        public class MyData
        {
            private ObservableCollection<Colors> Colors;
            private ObservableCollection<Fruits> Fruits;
...

    etc

I'm missing something here ... What is the story?

thank

+3
source share
2 answers

" ", / stackoverflow, , , , , !

( , msdn.microsoft.com) / , , .

+5

, , VS 2008 SP1. , 2 .

, , ( ).

, , , .

, , VS : c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

, class.cs , . VS , .

0

Source: https://habr.com/ru/post/1734336/


All Articles