示例#1
0
文件: Style.cs 项目: philstopford/Eto
 static void OnStyleWidget(object obj)
 {
     if (obj is Widget w)
     {
         StyleWidget?.Invoke(w);
     }
 }
示例#2
0
 void ApplyStyles(object widget, string style)
 {
     if (widget != null && !string.IsNullOrEmpty(style))
     {
         var styles = style.Split(' ');
         for (int i = 0; i < styles.Length; i++)
         {
             var currentStyle  = styles[i];
             var styleHandlers = GetStyleList(currentStyle);
             if (styleHandlers != null)
             {
                 for (int j = 0; j < styleHandlers.Count; j++)
                 {
                     var styleHandler = styleHandlers[j];
                     styleHandler(widget);
                 }
             }
         }
     }
     StyleWidget?.Invoke(widget);
 }