public static IUiElement PerformNavigateToPreviousSibling(this IUiElement element)
        {
            IUiElement result = null;

            var walker = new classic.TreeWalker(classic.Condition.TrueCondition);
            
            try {
                
                result = AutomationFactory.GetUiElement(walker.GetPreviousSibling(element.GetSourceElement() as classic.AutomationElement));
            } catch {
            }

            return result;
        }
        protected void GetAutomationElementsSiblings(bool nextSibling)
        {
            if (!CheckAndPrepareInput(this)) { return; }
            
            var walker = 
                new classic.TreeWalker(
                    classic.Condition.TrueCondition);
            
            // 20120823
            // 20131109
            //foreach (AutomationElement inputObject in this.InputObject) {
            /*
            foreach (IUiElement sibling in from inputObject in InputObject let sibling = null select nextSibling ? ObjectsFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement())) : ObjectsFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement())))
            {
                //if (nextSibling) {
                //    // 20120823
                //    //sibling = walker.GetNextSibling(this.InputObject);
                //    sibling = walker.GetNextSibling(inputObject);
                //} else {
                //    // 20120823
                //    //sibling = walker.GetPreviousSibling(this.InputObject);
                //    sibling = walker.GetPreviousSibling(inputObject);
                //}
                
                // 20131113
                // WriteObject(this, sibling);
                WriteObject(this, sibling);
            }
            */

            // 20140111
            // foreach (IUiElement sibling in from inputObject in InputObject let sibling = null select nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement() as AutomationElement)) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement() as AutomationElement)))
            // {
            //     WriteObject(this, sibling);
            // }
            
            foreach (IUiElement inputObject in InputObject) {
                
                IUiElement sibling = null;
                // 20140102
                // sibling = nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement())) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement()));
                sibling = nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement() as classic.AutomationElement)) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement() as classic.AutomationElement));
                
                WriteObject(this, sibling);
            
            } // 20120823
            

            /*
            foreach (IUiElement inputObject in this.InputObject) {
                
                // 20131109
                //AutomationElement sibling = null;
                //sibling = nextSibling ? walker.GetNextSibling(inputObject) : walker.GetPreviousSibling(inputObject);
                IUiElement sibling = null;
                // 20131112
                //sibling = nextSibling ? (new UiElement(walker.GetNextSibling(inputObject.SourceElement))) : (new UiElement(walker.GetPreviousSibling(inputObject.SourceElement)));
                sibling = nextSibling ? ObjectsFactory.GetUiElement(walker.GetNextSibling(inputObject.SourceElement)) : ObjectsFactory.GetUiElement(walker.GetPreviousSibling(inputObject.SourceElement));

                
                //if (nextSibling) {
                //    // 20120823
                //    //sibling = walker.GetNextSibling(this.InputObject);
                //    sibling = walker.GetNextSibling(inputObject);
                //} else {
                //    // 20120823
                //    //sibling = walker.GetPreviousSibling(this.InputObject);
                //    sibling = walker.GetPreviousSibling(inputObject);
                //}
                
                WriteObject(this, sibling);
            
            } // 20120823
            */
            
        }
        protected void GetAutomationElementsSiblings(bool nextSibling)
        {
            if (!CheckAndPrepareInput(this))
            {
                return;
            }

            var walker =
                new classic.TreeWalker(
                    classic.Condition.TrueCondition);

            // 20120823
            // 20131109
            //foreach (AutomationElement inputObject in this.InputObject) {

            /*
             * foreach (IUiElement sibling in from inputObject in InputObject let sibling = null select nextSibling ? ObjectsFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement())) : ObjectsFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement())))
             * {
             *  //if (nextSibling) {
             *  //    // 20120823
             *  //    //sibling = walker.GetNextSibling(this.InputObject);
             *  //    sibling = walker.GetNextSibling(inputObject);
             *  //} else {
             *  //    // 20120823
             *  //    //sibling = walker.GetPreviousSibling(this.InputObject);
             *  //    sibling = walker.GetPreviousSibling(inputObject);
             *  //}
             *
             *  // 20131113
             *  // WriteObject(this, sibling);
             *  WriteObject(this, sibling);
             * }
             */

            // 20140111
            // foreach (IUiElement sibling in from inputObject in InputObject let sibling = null select nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement() as AutomationElement)) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement() as AutomationElement)))
            // {
            //     WriteObject(this, sibling);
            // }

            foreach (IUiElement inputObject in InputObject)
            {
                IUiElement sibling = null;
                // 20140102
                // sibling = nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement())) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement()));
                sibling = nextSibling ? AutomationFactory.GetUiElement(walker.GetNextSibling(inputObject.GetSourceElement() as classic.AutomationElement)) : AutomationFactory.GetUiElement(walker.GetPreviousSibling(inputObject.GetSourceElement() as classic.AutomationElement));

                WriteObject(this, sibling);
            } // 20120823


            /*
             * foreach (IUiElement inputObject in this.InputObject) {
             *
             *  // 20131109
             *  //AutomationElement sibling = null;
             *  //sibling = nextSibling ? walker.GetNextSibling(inputObject) : walker.GetPreviousSibling(inputObject);
             *  IUiElement sibling = null;
             *  // 20131112
             *  //sibling = nextSibling ? (new UiElement(walker.GetNextSibling(inputObject.SourceElement))) : (new UiElement(walker.GetPreviousSibling(inputObject.SourceElement)));
             *  sibling = nextSibling ? ObjectsFactory.GetUiElement(walker.GetNextSibling(inputObject.SourceElement)) : ObjectsFactory.GetUiElement(walker.GetPreviousSibling(inputObject.SourceElement));
             *
             *
             *  //if (nextSibling) {
             *  //    // 20120823
             *  //    //sibling = walker.GetNextSibling(this.InputObject);
             *  //    sibling = walker.GetNextSibling(inputObject);
             *  //} else {
             *  //    // 20120823
             *  //    //sibling = walker.GetPreviousSibling(this.InputObject);
             *  //    sibling = walker.GetPreviousSibling(inputObject);
             *  //}
             *
             *  WriteObject(this, sibling);
             *
             * } // 20120823
             */
        }