System.ComponentModel.Design.Serialization.ContextStack.this C# (CSharp) 메소드

this() 공개 메소드

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
리턴 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