【发布时间】:2017-09-17 10:48:14
【问题描述】:
我有相互依赖的 class1 和 class2。我需要一个来自 class1 的值,如果它是静态的,它会与每件事都发生冲突。
简而言之就是这种关系
class one
{
static var a;
var b //the one that can't be static
static var c;
class two
{
public two()
{
do
{
c = f(a);
}
while( c == b )
}
public one(var A)
{
a = A;
b = 0;
for( somthing )
{
b = c;
two();
}
}
}
【问题讨论】:
-
请发布显示问题的代码;这甚至不会编译。
-
您认为为什么需要这样做?请看What is the XY problem?
-
您确实意识到这不是甚至远程有效的C#,对吧?
-
耶哈。但是代码乱七八糟,所以代码更能说明问题。