示例#1
0
        //HACK: when I finished this refactoring I realized that MenuItem should not inherit from ComponentParentAdapter, so
        //FIXME: to overcome the need of multiple inheritance, use an ImplementorHelper for selection related features and
        //       remove this transformation (although it may be useful for the case in which menus are added/removed)
        internal override void AddOneChild(Atk.Object child)
        {
            if (NAccessibleChildren > 0)
            {
                Log.Error("MenuItem adapter should not have any children.");
                return;
            }
            var parentMenu =
                AutomationBridge.CreateAdapter <ParentMenu> (Provider);

            if (parentMenu == null)
            {
                return;
            }
            AutomationBridge.PerformTransformation <ParentMenu> (this, parentMenu).AddOneChild(child);
        }
示例#2
0
        public SplitButton(IRawElementProviderSimple provider)
            : base(provider)
        {
            Role = Atk.Role.Filler;

            button = AutomationBridge.CreateAdapter <Button> (provider);
            if (button != null)
            {
                button.ManagesRemoval = true;
                base.AddOneChild(button);
            }

            ec_button = AutomationBridge.CreateAdapter <ExpandCollapseButton> (provider);
            if (ec_button != null)
            {
                ec_button.ManagesRemoval = true;
                base.AddOneChild(ec_button);
            }
        }
示例#3
0
 internal override void PostInit()
 {
     base.PostInit();
     if (balloonWindow)
     {
         fakeLabel = AutomationBridge.CreateAdapter <TextLabel> (Provider);
         if (fakeLabel != null)
         {
             AddOneChild(fakeLabel);
         }
         fakeImage = AutomationBridge.CreateAdapter <Image> (Provider);
         if (fakeImage != null)
         {
             AddOneChild(fakeImage);
         }
     }
     else
     {
         if (RefStateSet().ContainsState(Atk.StateType.Modal))
         {
             Role = Atk.Role.Dialog;
         }
     }
 }