Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol.GetBaseClass C# (CSharp) Method

GetBaseClass() public method

public GetBaseClass ( ) : AggregateType
return AggregateType
        public AggregateType GetBaseClass()
        {
            return _pBaseClass;
        }

Usage Example

Example #1
0
        public bool IsBaseAggregate(AggregateSymbol derived, AggregateSymbol @base)
        {
            Debug.Assert(!derived.IsEnum() && [email protected]());

            if (derived == @base)
            {
                return(true);      // identity.
            }
            // refactoring error tolerance:  structs and delegates can be base classes in error scenarios so
            // we cannot filter on whether or not the base is marked as sealed.

            if (@base.IsInterface())
            {
                // Search the direct and indirect interfaces via ifacesAll, going up the base chain...

                while (derived != null)
                {
                    for (int i = 0; i < derived.GetIfacesAll().Count; i++)
                    {
                        AggregateType iface = derived.GetIfacesAll()[i].AsAggregateType();
                        if (iface.getAggregate() == @base)
                        {
                            return(true);
                        }
                    }
                    derived = derived.GetBaseAgg();
                }

                return(false);
            }

            // base is a class. Just go up the base class chain to look for it.

            while (derived.GetBaseClass() != null)
            {
                derived = derived.GetBaseClass().getAggregate();
                if (derived == @base)
                {
                    return(true);
                }
            }
            return(false);
        }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol::GetBaseClass