コード例 #1
0
ファイル: Brain.cs プロジェクト: yanglr/dotNET-Gotchas
 public Brain(Brain another)
 {
     //Code to properly copy Brain can go here
 }
コード例 #2
0
ファイル: Brain.cs プロジェクト: yanglr/dotNET-Gotchas
 protected Brain(Brain another)
 {
     id =
         System.Threading.Interlocked.Increment(ref idCount);
 }
コード例 #3
0
ファイル: Person.cs プロジェクト: yanglr/dotNET-Gotchas
 public Person(int age, Brain aBrain)
 {
     theAge   = age;
     theBrain = aBrain;
 }
コード例 #4
0
ファイル: Person.cs プロジェクト: yanglr/dotNET-Gotchas
        //...
        public Person(Person another)
        {
            theAge = another.theAge;

            theBrain = another.theBrain.Clone() as Brain;
        }
コード例 #5
0
ファイル: Person.cs プロジェクト: yanglr/dotNET-Gotchas
 public Person(Person another)
 {
     theAge   = another.theAge;
     theBrain = new Brain(another.theBrain);
 }