Beispiel #1
0
        private LinkButton CreateButton(Control container, ItemDefinition definition)
        {
            var button = new LinkButton
            {
                ID   = "iel" + ID + "_" + definition.GetDiscriminatorWithTemplateKey().Replace('/', '_'),
                Text = string.IsNullOrEmpty(definition.IconUrl)
                    ? string.Format("<b class='{0}'></b> {1}", definition.IconClass, definition.Title)
                    : string.Format("<img src='{0}' alt='ico'/>{1}", definition.IconUrl, definition.Title),
                ToolTip          = definition.ToolTip,
                CausesValidation = false,
                CssClass         = "addButton"
            };
            var closureDefinition = definition;

            button.Command += (s, a) =>
            {
                ContentItem item = CreateItem(closureDefinition);
                item.ZoneName = ZoneName;
                AddedDefinitions.Add(closureDefinition.GetDiscriminatorWithTemplateKey());
                CreateItemEditor(item);
            };
            container.Controls.Add(button);
            return(button);
        }
Beispiel #2
0
 private LinkButton CreateButton(Control container, ItemDefinition definition)
 {
     var button = new LinkButton
     {
         ID = "iel" + ID + "_" + definition.GetDiscriminatorWithTemplateKey().Replace('/', '_'),
         Text = string.IsNullOrEmpty(definition.IconUrl)
             ? string.Format("<b class='{0}'></b> {1}", definition.IconClass, definition.Title)
             : string.Format("<img src='{0}' alt='ico'/>{1}", definition.IconUrl, definition.Title),
         ToolTip = definition.ToolTip,
         CausesValidation = false,
         CssClass = "addButton"
     };
     var closureDefinition = definition;
     button.Command += (s, a) =>
     {
         ContentItem item = CreateItem(closureDefinition);
         item.ZoneName = ZoneName;
         AddedDefinitions.Add(closureDefinition.GetDiscriminatorWithTemplateKey());
         CreateItemEditor(item);
     };
     container.Controls.Add(button);
     return button;
 }