Organizing c# code into different files

后端 未结 4 1725
礼貌的吻别
礼貌的吻别 2021-01-14 06:23

I\'ve gotten to a point where my main code file is about a thousand lines long and it\'s getting un-manageable; that is, I\'m starting to get confused and not know where to

4条回答
  •  时光取名叫无心
    2021-01-14 06:38

    Although what other people say about partial classes is true. I'd also suggest you to analyze refactoring opportunities on your class.

    If you're having problems to manage it, you could try to split your single class in several classes with less responsibilities.

    IMHO partial classes may not help very much. Do you have your class separated in regions? Regions improve the readability of your code.

提交回复
热议问题