C #에 들어가고 있는데이 문제가 있습니다.
namespace MyDataLayer
{
namespace Section1
{
public class MyClass
{
public class MyItem
{
public static string Property1{ get; set; }
}
public static MyItem GetItem()
{
MyItem theItem = new MyItem();
theItem.Property1 = "MyValue";
return theItem;
}
}
}
}
이 코드는 UserControl에 있습니다.
using MyDataLayer.Section1;
public class MyClass
{
protected void MyMethod
{
MyClass.MyItem oItem = new MyClass.MyItem();
oItem = MyClass.GetItem();
someLiteral.Text = oItem.Property1;
}
}
내가 접근 할 때를 제외하고는 모든 것이 잘 작동합니다 Property1. IntelliSense를 만 나 "제공 Equals, GetHashCode, GetType, 및 ToString"옵션으로. 에 마우스를 oItem.Property1올리면 Visual Studio에서 다음과 같은 설명을 제공합니다.
MemberMyDataLayer.Section1.MyClass.MyItem.Property1.getcannot be accessed with an instance reference, qualify it with a type name instead
이것이 무엇을 의미하는지 잘 모르겠습니다. 인터넷 검색을 수행했지만 알아낼 수 없었습니다.