不能訪問外類型的非靜態成員「Project.Neuro」經由 嵌套類型「Project.Neuro.Net '
與這樣的代碼(簡化):
class Neuro
{
public class Net
{
public void SomeMethod()
{
int x = OtherMethod(); // error is here
}
}
public int OtherMethod() // its outside Neuro.Net class
{
return 123;
}
}
我可以移動問題的方法Neuro.Net類,但我需要以外這種方法。
我是一種客觀的編程新手。
在此先感謝。
似乎很明顯 - 'OtherMethod'是另一種類型的成員。它嵌套的事實並不意味着這些方法是_inherited_。 – 2013-05-01 15:19:06
看到這個答案的更多信息:http://stackoverflow.com/a/5393472/1451531 – Splendor 2013-05-01 15:21:31