Exemple #1
0
 public void Setup(IWidget widget, FlexibleLayoutEditorContext context, IEditorService edsvc)
 {
     _widget = widget;
     _xml = _widget.ToXml();
     _widgetInfo = context.GetWidgetInfo(widget.Type);
     btnWidgetInfo.Enabled = (_widgetInfo != null);
     txtXmlContent.Text = _xml;
 }
        IWidget IApplicationDefinition.CreateWidget(string name, IWidgetInfo widgetInfo)
        {
            var wparams = widgetInfo.Parameters;

            IWidget widget = null;

            if (widgetInfo.StandardUi)
            {
                widget = new UiWidgetType()
                {
                    Disabled  = "false", //NOXLATE
                    Extension = new CustomContentType()
                    {
                        Any = new XmlElement[0]
                    },
                    ImageClass = widgetInfo.ImageClass ?? string.Empty, //Required to satisfy content model
                    ImageUrl   = widgetInfo.ImageUrl ?? string.Empty,   //Required to satisfy content model
                    Label      = widgetInfo.Label ?? string.Empty,      //Required to satisfy content model
                    Location   = widgetInfo.Location ?? string.Empty,   //Required to satisfy content model
                    Name       = name,
                    StatusText = widgetInfo.StatusText ?? string.Empty, //Required to satisfy content model
                    Tooltip    = widgetInfo.Tooltip ?? string.Empty,    //Required to satisfy content model
                    Type       = widgetInfo.Type
                };
            }
            else
            {
                widget = new WidgetType()
                {
                    Extension = new CustomContentType()
                    {
                        Any = new XmlElement[0]
                    },
                    Location = widgetInfo.Location ?? string.Empty, //Required to satisfy content model
                    Name     = name,
                    Type     = widgetInfo.Type,
                };
            }

            NameValueCollection extProperties = new NameValueCollection();

            foreach (var wp in widgetInfo.Parameters)
            {
                if (!string.IsNullOrEmpty(wp.DefaultValue))
                {
                    extProperties.Add(wp.Name, wp.DefaultValue);
                }
                else
                {
                    extProperties.Add(wp.Name, string.Empty);
                }
            }

            widget.SetAllValues(extProperties);

            return(widget);
        }
 public void Setup(IWidget widget, FlexibleLayoutEditorContext context, IEditorService edSvc)
 {
     _edSvc                = edSvc;
     _widget               = widget;
     _xml                  = _widget.ToXml();
     _widgetInfo           = context.GetWidgetInfo(widget.Type);
     btnWidgetInfo.Enabled = (_widgetInfo != null);
     txtXmlContent.Text    = _xml;
 }
 /// <summary>
 /// Initializes a new instance
 /// </summary>
 public WidgetInfoDialog(IWidgetInfo info)
 {
     InitializeComponent();
     this.Text += $" - {info.Type}"; //NOXLATE
     grdExtensionProperties.DataSource = info.Parameters;
 }
        IWidget IApplicationDefinition.CreateWidget(string name, IWidgetInfo widgetInfo)
        {
            var wparams = widgetInfo.Parameters;

            IWidget widget = null;

            if (widgetInfo.StandardUi)
            {
                widget = new UiWidgetType()
                {
                    Disabled = "false", //NOXLATE
                    Extension = new CustomContentType() { Any = new XmlElement[0] },
                    ImageClass = widgetInfo.ImageClass ?? string.Empty, //Required to satisfy content model
                    ImageUrl = widgetInfo.ImageUrl ?? string.Empty, //Required to satisfy content model
                    Label = widgetInfo.Label ?? string.Empty, //Required to satisfy content model
                    Location = widgetInfo.Location ?? string.Empty, //Required to satisfy content model
                    Name = name,
                    StatusText = widgetInfo.StatusText ?? string.Empty, //Required to satisfy content model
                    Tooltip = widgetInfo.Tooltip ?? string.Empty, //Required to satisfy content model
                    Type = widgetInfo.Type
                };
            }
            else
            {
                widget = new WidgetType()
                {
                    Extension = new CustomContentType() { Any = new XmlElement[0] },
                    Location = widgetInfo.Location ?? string.Empty, //Required to satisfy content model
                    Name = name,
                    Type = widgetInfo.Type,
                };
            }

            NameValueCollection extProperties = new NameValueCollection();

            foreach (var wp in widgetInfo.Parameters)
            {
                if (!string.IsNullOrEmpty(wp.DefaultValue))
                {
                    extProperties.Add(wp.Name, wp.DefaultValue);
                }
                else
                {
                    extProperties.Add(wp.Name, string.Empty);
                }
            }

            widget.SetAllValues(extProperties);

            return widget;
        }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance
 /// </summary>
 public WidgetInfoDialog(IWidgetInfo info)
 {
     InitializeComponent();
     this.Text += " - " + info.Type; //NOXLATE
     grdExtensionProperties.DataSource = info.Parameters;
 }