public virtual Terrasoft.UI.WebControls.Controls.MenuSeparator CreateMenuSeparator(string menuSeparatorCaption, Guid separatorId)
        {
            var menuSeparator = new Terrasoft.UI.WebControls.Controls.MenuSeparator();

            menuSeparator.UId = separatorId;
            if (!string.IsNullOrEmpty(menuSeparatorCaption))
            {
                menuSeparator.Caption = menuSeparatorCaption;
            }
            menuSeparator.CaptionColor = Color.FromArgb(0, 2, 77, 156);
            menuSeparator.Hidden       = false;
            return(menuSeparator);
        }
Пример #2
0
 public void CompleteButtonMenuItems(object /*PageSchemaUserControl*/ page, Terrasoft.UI.WebControls.Controls.Button button,
                                     Dictionary <string, string> itemTagsAndCaptions)
 {
     //if (Terrasoft.UI.WebControls.Ext.IsAjaxRequest) {
     button.Menu.RemoveAll();
     //}
     foreach (var itemTagAndCaption in itemTagsAndCaptions)
     {
         if (itemTagAndCaption.Value == "|")
         {
             if (!Terrasoft.UI.WebControls.Ext.IsAjaxRequest)
             {
                 var menuSeparator = new Terrasoft.UI.WebControls.Controls.MenuSeparator();
                 menuSeparator.Name = itemTagAndCaption.Key;
                 button.Menu.Add(menuSeparator);
             }
             else
             {
                 button.Menu.AddSeparator();
             }
             continue;
         }
         var menuItem = new Terrasoft.UI.WebControls.Controls.MenuItem();
         menuItem.UId     = Guid.NewGuid();
         menuItem.Name    = itemTagAndCaption.Key;
         menuItem.Caption = itemTagAndCaption.Value;
         menuItem.Tag     = itemTagAndCaption.Key;
         menuItem.Image   = new ControlImage {
         };
         button.Menu.Add(menuItem);
         if (Terrasoft.UI.WebControls.Ext.IsAjaxRequest)
         {
             button.Menu.AddCaptionItem(menuItem);
         }
     }
     if (itemTagsAndCaptions.Count > 0)
     {
         var        script          = button.ClientID + ".onContentChanged();";
         MethodInfo addScriptMethod = page.GetType().GetMethod("AddScript");
         addScriptMethod.Invoke(page, new object[] { script });
     }
     return;
 }