public WidgetDataElement Clone() { var copy = new WidgetDataElement() { WidgetID = this.WidgetID, Sequence = this.Sequence, Zone = this.Zone, ShowMode = this.ShowMode, Roles = this.Roles, Title = this.Title != null?this.Title.Clone() : null, Link = this.Link != null?this.Link.Clone() : null, Style = this.Style != null?this.Style.Clone() : null }; return(copy); }
internal static WidgetDataElement ToXmlElement(this WidgetInstance widget) { var descriptor = widget.WidgetDescriptor; var widgetData = new WidgetDataElement() { Title = new LocalizableElement() { Text = widget.Title }, Link = new LinkElement() { Source = widget.Link }, IconUrl = widget.IconUrl, Style = new WidgetStyleElement() { Header = new HeaderStyleElement() { Hidden = !widget.ShowHeader, Text = widget.HeaderCssText, CssClass = widget.HeaderClass, }, Body = new StyleElement() { CssClass = widget.BodyClass, Text = widget.BodyCssText }, Box = new StyleElement() { Text = widget.CssText } }, //ActionName = descriptor.Action, Zone = widget.ZoneID, Sequence = widget.Pos, //ControllerName = descriptor.Controller, WidgetID = descriptor.InstalledPath }; var _preferences = widget.ReadUserPreferences(); widgetData.Preferences = new List<PreferenceElement>(); foreach (var _pref in _preferences) { widgetData.Preferences.Add(new PreferenceElement() { Name = (string)_pref["name"], Value = (string)_pref["value"] }); } return widgetData; }
public WidgetDataElement Clone() { var copy = new WidgetDataElement() { WidgetID = this.WidgetID, Sequence = this.Sequence, Zone = this.Zone, ShowMode = this.ShowMode, Roles = this.Roles, Title = this.Title != null ? this.Title.Clone() : null, Link = this.Link != null ? this.Link.Clone() : null, Style = this.Style != null ? this.Style.Clone() : null }; return copy; }