How can I make a variable accessible to another class within the same project?

后端 未结 1 1496
小鲜肉
小鲜肉 2021-01-27 01:38

I have a variable (PrincipleIndex) in a class (Principles.cs) in one C# project (..\\Bullseye\\Biz Logic\\Trading\\Principle\\Data\\Principles.cs

相关标签:
1条回答
  • 2021-01-27 02:21

    Just add:

    private int principleIndex = 0;
    
    public int PrincipleIndex 
    {
        get { return principleIndex; }
    }
    
    ...
        // this must be within the Principles class
        Principles.Instance.principleIndex = Principles.Instance.RowIndexToPrincipleIndex(hti.Row);
    ...
    
    0 讨论(0)
提交回复
热议问题