/// <summary> /// Adds a custom toolbar item. /// </summary> /// <param name="itemId">The item id.</param> /// <param name="markup">The markup.</param> /// <param name="priority">The priority - is used for sorting multiple toolbar items.</param> public void AddCustomToolbarItem(string itemId, XDocument markup, ActionGroupPriority priority) { var externalDataExchangeService = WorkflowFacade.WorkflowRuntime.GetService <ExternalDataExchangeService>(); var fwas = externalDataExchangeService.GetService <IFormsWorkflowActivityService>(); Verify.That(WorkflowInstanceId == WorkflowEnvironment.WorkflowInstanceId, "Unexpected workflow id!"); fwas.AddCustomToolbarItem(WorkflowInstanceId, itemId, markup, priority); }
/// <summary> /// Initializes a new instance. /// </summary> /// <param name="priority">the priority/relecance of the action in relation to the element it is attached to</param> public ActionGroup(ActionGroupPriority priority) { if (priority != ActionGroupPriority.PrimaryHigh) { throw new ArgumentException("Unnamed action groups must be called with the PrimaryHigh priority. They serve as a way do deliver common core tasks, like 'delete'. Specify a group name if this is not a core action."); } this.Name = ""; this.Priority = priority; }
/// <summary> /// Initializes a new instance with a custom named group. /// </summary> /// <param name="name">A name of your choosing. If this name is used by multiple actions they may be bundled into the same group.</param> /// <param name="priority">the priority/relecance of the action in relation to the element it is attached to</param> public ActionGroup(string name, ActionGroupPriority priority) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Parameter 'name' must have a value"); } if (priority == ActionGroupPriority.PrimaryHigh) { throw new ArgumentException("Named action groups can not be called with the PrimaryHigh priority. They serve as a way do deliver non-core tasks, like 'search'."); } this.Name = name; this.Priority = priority; }
/// <summary> /// Initializes a new instance. /// </summary> /// <param name="priority">the priority/relecance of the action in relation to the element it is attached to</param> public ActionGroup(ActionGroupPriority priority) { if (priority!=ActionGroupPriority.PrimaryHigh) { throw new ArgumentException("Unnamed action groups must be called with the PrimaryHigh priority. They serve as a way do deliver common core tasks, like 'delete'. Specify a group name if this is not a core action."); } this.Name = ""; this.Priority = priority; }
public void AddCustomToolbarItem(Guid instanceId, string itemId, XDocument markup, ActionGroupPriority priority) { Verify.ArgumentNotNull(itemId, nameof(itemId)); Verify.ArgumentNotNull(markup, nameof(markup)); var formData = GetOrAddFormData(instanceId); if (formData.CustomToolbarItems == null) { formData.CustomToolbarItems = new List <Tuple <string, XDocument, ActionGroupPriority> >(); } else { var existingItem = formData.CustomToolbarItems.FirstOrDefault(i => i.Item1 == itemId); if (existingItem != null) { formData.CustomToolbarItems.Remove(existingItem); } } formData.CustomToolbarItems.Add(new Tuple <string, XDocument, ActionGroupPriority>( itemId, markup, priority)); }