コード例 #1
0
ファイル: LxStyleScope.cs プロジェクト: Ieeax/web
 public void Dispose()
 {
     if (_value != null)
     {
         StyleHandler.Detach(_value);
     }
 }
コード例 #2
0
        /// <summary>
        /// Adds a style for a widget handler
        /// </summary>
        /// <remarks>
        /// Styling a widget handler allows you to access both the widget and the platform-specifics for the widget.
        ///
        /// To use this, you would have to add a reference to one of the Eto.Platform.*.dll's so that you can utilize
        /// the platform handler directly.  Typically this would be called before your application is run.
        /// </remarks>
        /// <typeparam name="H">Type of the handler that should be styled</typeparam>
        /// <param name="style">Identifier for the style</param>
        /// <param name="styleHandler">Delegate with your logic to style the widget and/or platform control</param>
        public static void Add <H> (string style, StyleHandler <H> styleHandler)
            where H : class, IWidget
        {
            var list = GetStyleList((object)style ?? typeof(H));

            list.Add(delegate(InstanceWidget widget) {
                var handler = widget.Handler as H;
                if (handler != null)
                {
                    styleHandler(handler);
                }
            });
        }
コード例 #3
0
        /// <summary>
        /// Adds a style for a widget handler
        /// </summary>
        /// <remarks>
        /// Styling a widget handler allows you to access both the widget and the platform-specifics for the widget.
        ///
        /// To use this, you would have to add a reference to one of the Eto.*.dll's so that you can utilize
        /// the platform handler directly.  Typically this would be called before your application is run.
        /// </remarks>
        /// <typeparam name="THandler">Type of the handler that should be styled</typeparam>
        /// <param name="style">Identifier for the style</param>
        /// <param name="styleHandler">Delegate with your logic to style the widget and/or platform control</param>
        public static void Add <THandler>(string style, StyleHandler <THandler> styleHandler)
            where THandler : class, Widget.IHandler
        {
            var list = GetStyleList((object)style ?? typeof(THandler));

            list.Add(widget =>
            {
                var handler = widget.Handler as THandler;
                if (handler != null)
                {
                    styleHandler(handler);
                }
            });
        }
コード例 #4
0
 public static void AddHandler <H> (string style, StyleHandler <H> styleHandler)
     where H : class, IWidget
 {
     Style.Add <H> (style, styleHandler);
 }
コード例 #5
0
ファイル: Style.cs プロジェクト: philstopford/Eto
 /// <summary>
 /// Adds a style for a widget handler
 /// </summary>
 /// <remarks>
 /// Styling a widget handler allows you to access both the widget and the platform-specifics for the widget.
 ///
 /// To use this, you would have to add a reference to one of the Eto.*.dll's so that you can utilize
 /// the platform handler directly.  Typically this would be called before your application is run.
 /// </remarks>
 /// <typeparam name="THandler">Type of the handler that should be styled</typeparam>
 /// <param name="style">Identifier for the style</param>
 /// <param name="styleHandler">Delegate with your logic to style the widget and/or platform control</param>
 public static void Add <THandler>(string style, StyleHandler <THandler> styleHandler)
     where THandler : class, Widget.IHandler
 {
     Styles.Add <THandler>(style, w => styleHandler(w));
 }
コード例 #6
0
ファイル: Style.cs プロジェクト: sami1971/Eto
 public static void AddHandler <THandler>(string style, StyleHandler <THandler> styleHandler)
     where THandler : class, IWidget
 {
     Style.Add <THandler>(style, styleHandler);
 }