分類:[C#]
2006/05/12(Fri) 18:15:05 編集(投稿者)
コンパイルエラーになったソースを載せてもらうのが一番良いのですけど。
一応大雑把なサンプル)
public class Class1{
public struct StructPoint{
static int _X;
public static int X{
get { return _X; }
set { _X = value; }
}
}
}
public class Test1{
public static void Main( string[] args ){
Class1.StructPoint.X = 10;
Test2 t2 = new Test2();
t2.Show();
Test3 t3 = new Test3();
t3.Show();
Show();
}
public static void Show(){
System.Console.WriteLine( "{0}", Class1.StructPoint.X );
}
}
public class Test2{
public void Show(){
System.Console.WriteLine( "{0}", Class1.StructPoint.X );
Class1.StructPoint.X = 20;
}
}
public class Test3{
public void Show(){
System.Console.WriteLine( "{0}", Class1.StructPoint.X );
Class1.StructPoint.X = 30;
}
}