Пример #1
0
 public void ForeachWidget <T> (WidgetAction <T> action) where T : class
 {
     for (int i = 0; i < notebook.NPages; i++)
     {
         GtkUtilities.ForeachWidget(notebook.GetNthPage(i) as Container, action);
     }
 }
            GetStandardValues(ITypeDescriptorContext context)
            {
                List <string> names = new List <string>();
                WidgetAction  a     = (WidgetAction)context.Instance;

                foreach (HostSurface hs in HostSurface.hostSurfaces)
                {
                    Uitlity.GetWidgetNamesByActionType(hs.formDesignerHost.Container.Components, a.Action, names);
                }
                names.Sort();
                return(new StandardValuesCollection(names.ToArray()));
            }
Пример #3
0
        public static void ForeachWidget <T> (Container container, WidgetAction <T> action) where T : class
        {
            if (container == null)
            {
                return;
            }

            foreach (Widget child in container.Children)
            {
                T widget = child as T;
                if (widget != null)
                {
                    action(widget);
                }
                else
                {
                    Container child_container = child as Container;
                    if (child_container != null)
                    {
                        ForeachWidget <T> (child_container, action);
                    }
                }
            }
        }
 protected override bool Matches(WidgetAction action) =>
 action.GetType() == GetType();
 protected override bool InterferesWith(WidgetAction action) =>
 action.GetType() == GetType();
Пример #6
0
 public TriggerWidgetAction(string nameof_eventhandler, WidgetAction action)
 {
     NameofEventHandler = nameof_eventhandler;
     Action             = action;
 }
Пример #7
0
 public void ForEach(WidgetAction action)
 {
     foreach (Widget widget in widgets)
     {
         action(widget);
     }
 }
Пример #8
0
 protected override bool Matches(WidgetAction action) => throw new NotImplementedException();
Пример #9
0
 protected override bool InterferesWith(WidgetAction action) => throw new NotImplementedException();
Пример #10
0
 protected override bool Matches(WidgetAction action) =>
 action is SpinCube;
Пример #11
0
 protected override bool InterferesWith(WidgetAction action) =>
 false;