public override bool Equals(object obj) { NestedC other = obj as NestedC; if (other == null) { return(false); } return(this.ValueC == other.ValueC && this.ValueC2 == other.ValueC2); }
public override bool Equals(object obj) { NestedC other = obj as NestedC; if (other == null) { return(false); } return(this.Name == other.Name && this.Foo == other.Foo); }
static void Main() { // Creating an object from the overlapping class: NestedC c1 = new NestedC(); // Creating an object from the hidden class: BaseC.NestedC c2 = new BaseC.NestedC(); Console.WriteLine(c1.x); Console.WriteLine(c2.x); }
static void Main(string[] args) { NestedC nestedC = new NestedC(); Console.WriteLine($"x={nestedC.x};y={nestedC.y};z={nestedC.z}"); BaseC.NestedC nested = new BaseC.NestedC(); var d = new DerivedC(); var b = new BaseC(); b = d; Console.WriteLine($"x={nested.x};y={nested.y};"); }