private IWidgetModel GetModelFromJsonString(WidgetConfig widget, string jsonModel) { if (jsonModel != null) { return(JsonConvert.DeserializeObject(jsonModel, widget.ModelType) as IWidgetModel); } return(null); }
private IWidgetModel GetNamedModel(WidgetConfig widget, string namedModel) { foreach (var modelProvider in _namedModelProviders) { var model = modelProvider.GetModel(widget.WidgetType, namedModel, widget.ModelType); if (model != null) { return(model); } } return(null); }
private IWidgetModel GetModelFromJsonFile(WidgetConfig widget, string jsonFilePath) { if (!string.IsNullOrEmpty(jsonFilePath)) { var jsonModel = File.ReadAllText(jsonFilePath); if (string.IsNullOrEmpty(jsonModel.Trim())) { throw new NullReferenceException($"Cannot convert widget model. Null or empty file {jsonFilePath}"); } return(GetModelFromJsonString(widget, jsonModel)); } return(null); }
internal WidgetFormEntry(WidgetConfig widget, Type componentType) { Widget = widget; ComponentType = componentType; Tabs = new List <string>(); }
public WidgetBuilder(WidgetConfig config) { _widget = config; }
internal WidgetEditorEntry(WidgetConfig widget, Type componentType) { Widget = widget; ComponentType = componentType; }