Best way to expose protected fields

前端 未结 6 992
不知归路
不知归路 2021-01-19 05:50

I have a base class like this:

 public class BaseModalCommand
 {

    protected object m_commandArgument;
    protected int m_commandID;
    protected int m_         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-19 06:12

    Use properties. Change the member variables to private and then setup protected properties for each member variable.

    Regards,
    Frank

提交回复
热议问题