コード例 #1
0
        private Stack <int> ToIndexStack(IXPathNode node)
        {
            XPathAdapter          adapter = node as XPathAdapter;
            XPathAttributeAdapter attr    = node as XPathAttributeAdapter;

            if (attr != null)
            {
                adapter = attr.Owner;
            }

            if (adapter != null)
            {
                UIAControl  control = adapter.Owner;
                Stack <int> result  = new Stack <int>();

                do
                {
                    result.Push(control.Index);
                    control = (UIAControl)control.Parent;
                } while(control != null);

                return(result);
            }

            throw new ArgumentException("Trying to sort a node I don't know.");
        }
コード例 #2
0
        public bool Equals(IXPathNode other)
        {
            XPathAttributeAdapter adapter = other as XPathAttributeAdapter;

            if (object.ReferenceEquals(adapter, null))
            {
                return(false);
            }

            if (object.ReferenceEquals(adapter, this))
            {
                return(true);
            }

            return(_owner == adapter._owner && _prop == adapter._prop);
        }