Ejemplo n.º 1
0
        public static void Add <W, C> (string style, StyleWidgetControlHandler <W, C> handler)
            where W : InstanceWidget
            where C : class
        {
            var list = GetStyleList(style);

            list.Add(delegate(InstanceWidget widget) {
                var control = widget as W;
                if (control != null)
                {
                    var controlObject = control.ControlObject as C;
                    if (controlObject != null)
                    {
                        handler(control, controlObject);
                    }
                }
            });
        }
Ejemplo n.º 2
0
        public static void Add <TWidget, TControl>(string style, StyleWidgetControlHandler <TWidget, TControl> handler)
            where TWidget : InstanceWidget
            where TControl : class
        {
            var list = GetStyleList(style);

            list.Add(delegate(InstanceWidget widget)
            {
                var control = widget as TWidget;
                if (control != null)
                {
                    var controlObject = control.ControlObject as TControl;
                    if (controlObject != null)
                    {
                        handler(control, controlObject);
                    }
                }
            });
        }