Esempio n. 1
0
 /// <summary>
 /// Adds the "Move" action to the menu.
 /// </summary>
 /// <param name="menu">
 /// The menu items to add the action to.
 /// </param>
 /// <param name="form">
 /// The form.
 /// </param>
 public void AddMoveFormAction(MenuItemCollection menu, Form form)
 {
     var path = "/App_Plugins/formulate/menu-actions/moveForm.html";
     var menuItem = new MenuItem()
     {
         Alias = "moveForm",
         Icon = "formulate-move",
         Name = LocalizationHelper.GetMenuItemName("Move")
     };
     var titleFormat = @"Move ""{0}"" Form";
     var title = string.Format(titleFormat, form.Name);
     menuItem.LaunchDialogView(path, title);
     menu.Items.Add(menuItem);
 }
Esempio n. 2
0
 /// <summary>
 /// Adds a form node to the tree.
 /// </summary>
 /// <param name="nodes">
 /// The node collection to add the form to.
 /// </param>
 /// <param name="queryStrings">The query strings.</param>
 /// <param name="form">The form to add.</param>
 public void AddFormToTree(TreeNodeCollection nodes,
     FormDataCollection queryStrings, Form form)
 {
     var formatUrl = "/formulate/formulate/editForm/{0}";
     var formId = GuidHelper.GetString(form.Id);
     var formRoute = string.Format(formatUrl, formId);
     var formName = form.Name.Fallback("Unnamed");
     var parentId = form.Path[form.Path.Length - 2];
     var strParentId = GuidHelper.GetString(parentId);
     var hasChildren = Persistence
         .RetrieveChildren(form.Id).Any();
     var formNode = Tree.CreateTreeNode(formId,
         strParentId, queryStrings,
         formName, FormConstants.ItemIcon, hasChildren, formRoute);
     nodes.Add(formNode);
 }