private static void OnExecuteDesignerVerb(object sender, EventArgs e) { ActivityDesignerVerb activityDesignerVerb = sender as ActivityDesignerVerb; if (activityDesignerVerb != null) { if (activityDesignerVerb.invokeHandler != null) { activityDesignerVerb.invokeHandler(sender, e); } int status = activityDesignerVerb.OleStatus; status = 0; if (activityDesignerVerb.activityDesigner != null) { foreach (DesignerVerb verb in ((IDesigner)activityDesignerVerb.activityDesigner).Verbs) { if (verb is ActivityDesignerVerb) { //Update the status of the status = verb.OleStatus; status = 0; } } } } }
public Palette(ItemPalette parent, Point location) { this.parent = parent; this.enabledItems = new ItemList <System.Workflow.ComponentModel.Design.ItemInfo>(this); foreach (System.Workflow.ComponentModel.Design.ItemInfo info in this.parent.items) { ActivityDesignerVerb verb = info.UserData[DesignerUserDataKeys.DesignerVerb] as ActivityDesignerVerb; if ((verb == null) || verb.Enabled) { this.enabledItems.Add(info); } } this.menuItemCount = this.enabledItems.Count; base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); base.FormBorderStyle = FormBorderStyle.None; this.BackColor = Color.White; base.ShowInTaskbar = false; base.MaximizeBox = false; base.ControlBox = false; base.StartPosition = FormStartPosition.Manual; Screen screen = Screen.FromPoint(location); this.workingRectangle = screen.WorkingArea; this.PreparePalette(location); this.paletteShadow = new PaletteShadow(this); }
private void OnStatusAddBranch(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; if (verb != null) { verb.Enabled = IsEditable; } }
private void OnSmartTagVerbStatus(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; DesignerView view = verb.Properties[DesignerUserDataKeys.DesignerView] as DesignerView; if (view != null) { verb.Checked = view == this.ActiveView; } }
private void OnSmartAction(object sender, SelectionChangeEventArgs e) { System.Workflow.ComponentModel.Design.ItemInfo currentItem = e.CurrentItem; if (currentItem != null) { ActivityDesignerVerb verb = currentItem.UserData[DesignerUserDataKeys.DesignerVerb] as ActivityDesignerVerb; if (verb != null) { verb.Invoke(); } } }
private void OnSmartAction(object sender, SelectionChangeEventArgs e) { ItemInfo itemInfo = e.CurrentItem as ItemInfo; if (itemInfo != null) { ActivityDesignerVerb smartVerb = itemInfo.UserData[DesignerUserDataKeys.DesignerVerb] as ActivityDesignerVerb; if (smartVerb != null) { smartVerb.Invoke(); } } }
private void OnZOrderStatusUpdate(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; if ((verb != null) && verb.Properties.Contains(DesignerUserDataKeys.ZOrderKey)) { FreeformActivityDesigner parentDesigner = verb.ActivityDesigner.ParentDesigner as FreeformActivityDesigner; if (parentDesigner != null) { verb.Enabled = parentDesigner.CanUpdateZOrder(verb.ActivityDesigner, (ZOrder)verb.Properties[DesignerUserDataKeys.ZOrderKey]); } } }
ActivityDesignerVerbCollection IDesignerVerbProvider.GetVerbs(ActivityDesigner activityDesigner) { ActivityDesignerVerbCollection verbs = new ActivityDesignerVerbCollection(); if (activityDesigner.ParentDesigner is FreeformActivityDesigner) { ActivityDesignerVerb verb = new ActivityDesignerVerb(activityDesigner, DesignerVerbGroup.Actions, DR.GetString("BringToFront", new object[0]), new EventHandler(this.OnZOrderChanged), new EventHandler(this.OnZOrderStatusUpdate)); verb.Properties[DesignerUserDataKeys.ZOrderKey] = ZOrder.Foreground; verbs.Add(verb); verb = new ActivityDesignerVerb(activityDesigner, DesignerVerbGroup.Actions, DR.GetString("SendToBack", new object[0]), new EventHandler(this.OnZOrderChanged), new EventHandler(this.OnZOrderStatusUpdate)); verb.Properties[DesignerUserDataKeys.ZOrderKey] = ZOrder.Background; verbs.Add(verb); } return verbs; }
public int Compare(object x, object y) { ActivityDesignerVerb verb = x as ActivityDesignerVerb; ActivityDesignerVerb verb2 = y as ActivityDesignerVerb; if (verb.Id == verb2.Id) { return(0); } if (verb.Id > verb2.Id) { return(1); } return(-1); }
ActivityDesignerVerbCollection IDesignerVerbProvider.GetVerbs(ActivityDesigner activityDesigner) { ActivityDesignerVerbCollection verbs = new ActivityDesignerVerbCollection(); if (activityDesigner.ParentDesigner is FreeformActivityDesigner) { ActivityDesignerVerb verb = new ActivityDesignerVerb(activityDesigner, DesignerVerbGroup.Actions, DR.GetString("BringToFront", new object[0]), new EventHandler(this.OnZOrderChanged), new EventHandler(this.OnZOrderStatusUpdate)); verb.Properties[DesignerUserDataKeys.ZOrderKey] = ZOrder.Foreground; verbs.Add(verb); verb = new ActivityDesignerVerb(activityDesigner, DesignerVerbGroup.Actions, DR.GetString("SendToBack", new object[0]), new EventHandler(this.OnZOrderChanged), new EventHandler(this.OnZOrderStatusUpdate)); verb.Properties[DesignerUserDataKeys.ZOrderKey] = ZOrder.Background; verbs.Add(verb); } return(verbs); }
private void OnSmartTagVerb(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; DesignerView view = verb.Properties[DesignerUserDataKeys.DesignerView] as DesignerView; if (view != null) { this.ActiveView = view; if (this.Expanded && (view.AssociatedDesigner != null)) { ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService; if (service != null) { service.SetSelectedComponents(new object[] { view.AssociatedDesigner.Activity }, SelectionTypes.Replace); } } } }
private void OnZOrderChanged(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; if ((verb != null) && verb.Properties.Contains(DesignerUserDataKeys.ZOrderKey)) { FreeformActivityDesigner parentDesigner = verb.ActivityDesigner.ParentDesigner as FreeformActivityDesigner; if (parentDesigner != null) { if (((ZOrder)verb.Properties[DesignerUserDataKeys.ZOrderKey]) == ZOrder.Foreground) { parentDesigner.BringToFront(verb.ActivityDesigner); } else if (((ZOrder)verb.Properties[DesignerUserDataKeys.ZOrderKey]) == ZOrder.Background) { parentDesigner.SendToBack(verb.ActivityDesigner); } } } }
private static void OnExecuteDesignerVerb(object sender, EventArgs e) { ActivityDesignerVerb verb = sender as ActivityDesignerVerb; if (verb != null) { if (verb.invokeHandler != null) { verb.invokeHandler(sender, e); } int oleStatus = verb.OleStatus; if (verb.activityDesigner != null) { foreach (DesignerVerb verb2 in ((IDesigner)verb.activityDesigner).Verbs) { if (verb2 is ActivityDesignerVerb) { int num2 = verb2.OleStatus; } } } } }