AddOneChild() private method

private AddOneChild ( Atk child ) : void
child Atk
return void
Beispiel #1
0
        public override void RaiseAutomationPropertyChangedEvent(System.Windows.Automation.AutomationPropertyChangedEventArgs e)
        {
            if (e.Property.Id != ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty.Id)
            {
                base.RaiseAutomationPropertyChangedEvent(e);
                return;
            }

            ExpandCollapseState newState = (ExpandCollapseState)e.NewValue;

            if (newState == ExpandCollapseState.Expanded)
            {
                if (fakeWindow == null)
                {
                    fakeWindow = new DropDownWindow();
                    fakeWindow.AddOneChild((Adapter)RefAccessibleChild(0));
                }
                TopLevelRootItem.Instance.AddOneChild(fakeWindow);
                TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow(fakeWindow);
            }
            else if (newState == ExpandCollapseState.Collapsed)
            {
                Atk.Object realWindow = this;
                while (realWindow != null && !(realWindow is Window))
                {
                    realWindow = realWindow.Parent;
                }
                if (realWindow != null)
                {
                    TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow(fakeWindow, (Window)realWindow);
                }
                TopLevelRootItem.Instance.RemoveChild(fakeWindow, false);
            }
            InnerMenu.RaiseExpandedCollapsed();
        }
Beispiel #2
0
		public override void RaiseAutomationPropertyChangedEvent (System.Windows.Automation.AutomationPropertyChangedEventArgs e)
		{
			if (e.Property.Id != ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty.Id) {
				base.RaiseAutomationPropertyChangedEvent (e);
				return;
			}

			ExpandCollapseState newState = (ExpandCollapseState)e.NewValue;
			if (newState == ExpandCollapseState.Expanded) {
				if (fakeWindow == null) {
					fakeWindow = new DropDownWindow ();
					fakeWindow.AddOneChild ((Adapter)RefAccessibleChild (0));
				}
				TopLevelRootItem.Instance.AddOneChild (fakeWindow);
				TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow (fakeWindow);
			} else if (newState == ExpandCollapseState.Collapsed) {
				Atk.Object realWindow = this;
				while (realWindow != null && !(realWindow is Window))
					realWindow = realWindow.Parent;
				if (realWindow != null)
					TopLevelRootItem.Instance.CheckAndHandleNewActiveWindow (fakeWindow, (Window)realWindow);
				TopLevelRootItem.Instance.RemoveChild (fakeWindow, false);
			}
			InnerMenu.RaiseExpandedCollapsed ();
		}