예제 #1
0
        /// <summary>
        /// Sets widget properties if config object exists for node
        /// </summary>
        /// <param name="widget"></param>
        public static void SetWidgetByConfig(BaseWidgetControl widget)
        {
            WidgetConfig config = WidgetConfig.GetByName(widget.Name);

            if (config != null)
            {
                SetWidgetByConfig(widget, config);
            }
        }
예제 #2
0
 /// <summary>
 /// Sets widget properties via config object
 /// </summary>
 /// <param name="widget"></param>
 /// <param name="config"></param>
 public static void SetWidgetByConfig(BaseWidgetControl widget, WidgetConfig config)
 {
     widget.Title       = config.Title;
     widget.Description = config.Description;
     widget.HelpText    = config.HelpText;
     widget.Modules     = config.Modules.ToArray();
     // set default widget state (if applicable)
     if (!string.IsNullOrEmpty(config.DefaultState))
     {
         widget.SetWidgetState(config.DefaultState);
     }
 }