System.ComponentModel.Design.Serialization.ContextStack.this C# (CSharp) Méthode

this() public méthode

Retrieves the first object on the stack that inherits from or implements the given type, or null if no object on the stack implements the type.
public this ( Type type ) : object
type Type
Résultat object
        public object this[Type type]
        {
            get
            {
                if (type == null)
                {
                    throw new ArgumentNullException(nameof(type));
                }

                if (_contextStack != null)
                {
                    int level = _contextStack.Count;
                    while (level > 0)
                    {
                        object value = _contextStack[--level];
                        if (type.IsInstanceOfType(value))
                        {
                            return value;
                        }
                    }
                }

                return null;
            }
        }

Same methods

ContextStack::this ( int level ) : object