【发布时间】:2008-10-08 21:16:15
【问题描述】:
我正在使用部分类在 2 个文件之间拆分某些功能,但出现错误。我做错了什么?
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'
}
}
【问题讨论】:
标签: c# partial-classes