protected virtual Terrasoft.UI.WebControls.Controls.Button CreateButton1()
 {
     _button1      = new Terrasoft.UI.WebControls.Controls.Button();
     _button1.UId  = new Guid("504c3e32-c266-4920-9e78-9f4063d24e3d");
     _button1.Name = "Button1";
     _button1.CreatedInSchemaUId  = new Guid("814acfab-5d7f-4f39-b38d-5c9801c8bec5");
     _button1.ModifiedInSchemaUId = new Guid("814acfab-5d7f-4f39-b38d-5c9801c8bec5");
     _button1.CreatedInPackageId  = new Guid("1ac017e5-6977-4f88-8d97-6d00b9321f95");
     _button1.AjaxEvents.Click.IsProcessEventHandler = true;
     _button1.Tag   = "";
     _button1.Image = new ControlImage {
     };
     return(_button1);
 }
Example #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;
 }