我正在使用部分類來分割2個文件之間的某些功能,但出現錯誤。我究竟做錯了什麼?C#部分類錯誤
A1.cs:
private partial class A
{
private string SomeProperty { get { return "SomeGeneratedString"; } }
}
A2.cs:
private partial class A
{
void SomeFunction()
{
//trying to access this.SomeProperty produces the following compiler error, at least with C# 2.0
//error CS0117: 'A' does not contain a definition for 'SomeProperty'
}
}
你走吧!謝謝 – 2015-11-19 09:56:29