/// <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); } }
/// <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); } }