Beispiel #1
0
 static void RefPassByValue()
 {
     ShapeInfo info1 = new ShapeInfo("info1");
     info1.Display();
     RefPassByValueModify(info1);
     info1.Display();
     RefPassByRefModify(ref info1);
     info1.Display();
 }
Beispiel #2
0
 static void RefPassByValueModify(ShapeInfo info)
 {
     info.InfoString = "infoString_modified";
     info = new ShapeInfo("info_modified!");
 }
Beispiel #3
0
 static void RefPassByRefModify(ref ShapeInfo info)
 {
     info.InfoString = "infoString_modified";
     info = new ShapeInfo("info_modified!");
     //info.InfoString = "infoString_modified";
 }
Beispiel #4
0
 public Rectangle(string info, int left, int right, int top, int bottom)
 {
     Left = left; Right = right; Top = top; Bottom = bottom;
     SInfo = new ShapeInfo(info);
 }