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);
    }
예제 #2
0
    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);
    }
예제 #3
0
    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()
    {
        // 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);
    }
예제 #5
0
        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};");
        }