Ejemplo n.º 1
0
 public override System.Workflow.ComponentModel.Design.HitTestInfo HitTest(Point point)
 {
     System.Workflow.ComponentModel.Design.HitTestInfo nowhere = System.Workflow.ComponentModel.Design.HitTestInfo.Nowhere;
     if (this.Expanded && (base.ActiveDesigner == this))
     {
         if ((this.ContainedDesigners.Count == 0) && this.HelpTextRectangle.Contains(point))
         {
             return(new ConnectorHitTestInfo(this, HitTestLocations.Designer, 0));
         }
         if (this.previewStrip.Bounds.Contains(point))
         {
             System.Workflow.ComponentModel.Design.ItemInfo info2 = this.previewStrip.HitTest(point);
             ActivityDesigner designer = (info2 != null) ? ActivityDesigner.GetDesigner(info2.UserData[DesignerUserDataKeys.Activity] as Activity) : null;
             if (designer != null)
             {
                 return(new System.Workflow.ComponentModel.Design.HitTestInfo(designer, HitTestLocations.Designer));
             }
             return(new System.Workflow.ComponentModel.Design.HitTestInfo(this, HitTestLocations.ActionArea | HitTestLocations.Designer));
         }
         if ((this.ShowPreview && this.previewWindow.Bounds.Contains(point)) && ((this.previewWindow.PreviewMode || (this.PreviewedDesigner == null)) || !this.PreviewedDesigner.Bounds.Contains(point)))
         {
             return(new System.Workflow.ComponentModel.Design.HitTestInfo(this, HitTestLocations.ActionArea | HitTestLocations.Designer));
         }
         nowhere = base.HitTest(point);
         if ((this.ShowPreview && this.previewWindow.PreviewMode) && (nowhere.AssociatedDesigner != this))
         {
             nowhere = System.Workflow.ComponentModel.Design.HitTestInfo.Nowhere;
         }
         return(nowhere);
     }
     return(base.HitTest(point));
 }
Ejemplo n.º 2
0
        protected override void Initialize(Activity activity)
        {
            base.Initialize(activity);
            this.ShowPreview = true;
            CompositeActivity activity2 = base.Activity as CompositeActivity;

            if (activity2 != null)
            {
                foreach (Activity activity3 in activity2.Activities)
                {
                    if (!Helpers.IsAlternateFlowActivity(activity3))
                    {
                        System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(activity3.GetHashCode());
                        item.UserData[DesignerUserDataKeys.Activity] = activity3;
                        this.previewStrip.Items.Add(item);
                    }
                }
            }
            ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService;

            if (service != null)
            {
                service.SelectionChanged += new EventHandler(this.OnSelectionChanged);
            }
        }
Ejemplo n.º 3
0
        protected override void LoadViewState(BinaryReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            int num = reader.ReadInt32();

            if ((num != -1) && (num < this.previewStrip.Items.Count))
            {
                System.Workflow.ComponentModel.Design.ItemInfo info = this.previewStrip.Items[num];
                IDesignerHost service = base.GetService(typeof(IDesignerHost)) as IDesignerHost;
                if (service == null)
                {
                    throw new Exception(SR.GetString("General_MissingService", new object[] { typeof(IDesignerHost).FullName }));
                }
                this.EnsureVisibleContainedDesigner(service.GetDesigner((Activity)info.UserData[DesignerUserDataKeys.Activity]) as ActivityDesigner);
            }
            bool flag = reader.ReadBoolean();

            if (this.ShowPreview)
            {
                this.previewWindow.PreviewMode = flag;
            }
            base.LoadViewState(reader);
        }
            public override void Draw(Graphics graphics)
            {
                GraphicsContainer container = graphics.BeginContainer();
                Rectangle         bounds    = base.Bounds;

                using (Region region = new Region(new Rectangle(bounds.X, bounds.Y, bounds.Width + 1, bounds.Height + 1)))
                {
                    graphics.Clip = region;
                    StringFormat format = new StringFormat {
                        Alignment     = StringAlignment.Center,
                        LineAlignment = StringAlignment.Center,
                        Trimming      = StringTrimming.Character,
                        FormatFlags   = StringFormatFlags.NoWrap
                    };
                    int maxVisibleItems = base.MaxVisibleItems;
                    int scrollPosition  = base.ScrollPosition;
                    for (int i = scrollPosition; (i < base.Items.Count) && (i < (scrollPosition + maxVisibleItems)); i++)
                    {
                        System.Workflow.ComponentModel.Design.ItemInfo itemInfo = base.Items[i];
                        Rectangle      itemBounds   = base.GetItemBounds(itemInfo);
                        int            pageFoldSize = itemBounds.Width / 5;
                        GraphicsPath[] pathArray    = ActivityDesignerPaint.GetPagePaths(itemBounds, pageFoldSize, DesignerContentAlignment.TopRight);
                        using (GraphicsPath path = pathArray[0])
                        {
                            using (GraphicsPath path2 = pathArray[1])
                            {
                                Brush white = Brushes.White;
                                if (base.SelectedItem == itemInfo)
                                {
                                    white = PageStrip.SelectionBrush;
                                }
                                else if (base.HighlitedItem == itemInfo)
                                {
                                    white = PageStrip.HighliteBrush;
                                }
                                graphics.FillPath(white, path);
                                graphics.DrawPath(Pens.DarkBlue, path);
                                graphics.FillPath(Brushes.White, path2);
                                graphics.DrawPath(Pens.DarkBlue, path2);
                                if (itemInfo.Image == null)
                                {
                                    itemBounds.Y      += pageFoldSize;
                                    itemBounds.Height -= pageFoldSize;
                                    graphics.DrawString((i + 1).ToString(CultureInfo.CurrentCulture), Control.DefaultFont, SystemBrushes.ControlText, itemBounds, format);
                                }
                                else
                                {
                                    itemBounds.Y      += pageFoldSize;
                                    itemBounds.Height -= pageFoldSize;
                                    itemBounds.X      += (itemBounds.Width - itemBounds.Height) / 2;
                                    itemBounds.Width   = itemBounds.Height;
                                    itemBounds.Inflate(-2, -2);
                                    ActivityDesignerPaint.DrawImage(graphics, itemInfo.Image, itemBounds, DesignerContentAlignment.Center);
                                }
                            }
                        }
                    }
                }
                graphics.EndContainer(container);
            }
Ejemplo n.º 5
0
            protected override void OnMouseDown(MouseEventArgs e)
            {
                base.OnMouseDown(e);
                System.Workflow.ComponentModel.Design.ItemInfo info = null;
                Point pt = new Point(e.X, e.Y);

                for (int i = 0; i < this.enabledItems.Count; i++)
                {
                    if (this.GetItemBounds(i).Contains(pt))
                    {
                        info = this.enabledItems[i];
                        break;
                    }
                }
                if (info != null)
                {
                    try
                    {
                        this.parent.SelectedItem = info;
                    }
                    finally
                    {
                        this.parent.DestroyPalette(this);
                    }
                }
            }
Ejemplo n.º 6
0
            private void LayoutPalette()
            {
                this.itemRectangles.Clear();
                this.leftGradientRectangle = Rectangle.Empty;
                using (Graphics graphics = base.CreateGraphics())
                {
                    Size empty = Size.Empty;
                    foreach (System.Workflow.ComponentModel.Design.ItemInfo info in this.enabledItems)
                    {
                        SizeF ef = graphics.MeasureString(info.Text, this.Font);
                        empty.Width  = Math.Max(Convert.ToInt32(Math.Ceiling((double)ef.Width)), empty.Width);
                        empty.Height = Math.Max(Convert.ToInt32(Math.Ceiling((double)ef.Height)), empty.Height);
                    }
                    empty.Width        = Math.Min(empty.Width, this.maximumTextWidth);
                    this.maxTextHeight = empty.Height;
                    this.itemHeight    = Math.Max(this.imageRectangle.Height, empty.Height + 2) + 3;
                    this.itemWidth     = (((this.imageRectangle.Width + (2 * this.selectionItemMargin.Width)) + this.leftTextMargin) + empty.Width) + this.rightTextMargin;
                }
                int y = 2;

                using (List <System.Workflow.ComponentModel.Design.ItemInfo> .Enumerator enumerator2 = this.enabledItems.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        System.Workflow.ComponentModel.Design.ItemInfo current = enumerator2.Current;
                        this.itemRectangles.Add(new Rectangle(2, y, this.itemWidth, this.itemHeight));
                        y += this.itemHeight + (2 * this.selectionItemMargin.Height);
                    }
                }
                this.leftGradientRectangle = new Rectangle(2, 2, 0x18, y - 4);
                this.formRectangle         = new Rectangle(0, 0, this.itemWidth + 4, y);
            }
Ejemplo n.º 7
0
 protected override void OnContainedActivitiesChanged(ActivityCollectionChangeEventArgs listChangeArgs)
 {
     if (base.ActiveDesigner == this)
     {
         if (((listChangeArgs.Action == ActivityCollectionChangeAction.Add) && (listChangeArgs.AddedItems.Count > 0)) && !Helpers.IsAlternateFlowActivity(listChangeArgs.AddedItems[0]))
         {
             System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.AddedItems[0].GetHashCode());
             item.UserData[DesignerUserDataKeys.Activity] = listChangeArgs.AddedItems[0];
             if (listChangeArgs.Index < this.previewStrip.Items.Count)
             {
                 this.previewStrip.Items.Insert(listChangeArgs.Index, item);
             }
             else
             {
                 this.previewStrip.Items.Add(item);
             }
         }
         else if ((listChangeArgs.Action == ActivityCollectionChangeAction.Remove) && (listChangeArgs.RemovedItems.Count > 0))
         {
             int index = this.previewStrip.Items.IndexOf(new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.RemovedItems[0].GetHashCode()));
             if (index >= 0)
             {
                 this.previewStrip.Items.RemoveAt(index);
             }
         }
     }
     base.OnContainedActivitiesChanged(listChangeArgs);
 }
 public virtual void OnMouseMove(MouseEventArgs e)
 {
     System.Workflow.ComponentModel.Design.ItemInfo info = this.HitTest(new Point(e.X, e.Y));
     if (((info != null) && (info.Text != null)) && (info.Text.Length > 0))
     {
         this.ShowInfoTip(info.Text);
     }
     this.HighlitedItem = info;
 }
 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();
         }
     }
 }
Ejemplo n.º 10
0
        private Rectangle GetTabItemRectangle(System.Workflow.ComponentModel.Design.ItemInfo tabItemInfo)
        {
            int index = this.tabItemList.IndexOf(tabItemInfo);

            if (index < 0)
            {
                throw new ArgumentException(DR.GetString("ButtonInformationMissing", new object[0]));
            }
            if (this.drawItems.Length == this.tabItemList.Count)
            {
                return(this.drawItems[index].TabItemRectangle);
            }
            return(Rectangle.Empty);
        }
Ejemplo n.º 11
0
        private void OnViewActivity(object sender, EventArgs args)
        {
            DesignerVerb verb = sender as DesignerVerb;

            if ((verb != null) && verb.Properties.Contains(DesignerUserDataKeys.ViewActivity))
            {
                System.Workflow.ComponentModel.Design.ItemInfo activeItem = this.previewStrip.ActiveItem;
                if (activeItem != null)
                {
                    bool flag = (bool)verb.Properties[DesignerUserDataKeys.ViewActivity];
                    int  num  = this.previewStrip.Items.IndexOf(activeItem) + (flag ? 1 : -1);
                    num = (num >= this.previewStrip.Items.Count) ? 0 : ((num < 0) ? (this.previewStrip.Items.Count - 1) : num);
                    this.previewStrip.ActiveItem = this.previewStrip.Items[num];
                }
            }
        }
Ejemplo n.º 12
0
        private Rectangle GetTabImageRectangle(System.Workflow.ComponentModel.Design.ItemInfo tabItemInfo)
        {
            int index = this.tabItemList.IndexOf(tabItemInfo);

            if (index < 0)
            {
                throw new ArgumentException(DR.GetString("ButtonInformationMissing", new object[0]));
            }
            Rectangle empty = Rectangle.Empty;

            if ((tabItemInfo.Image != null) && (this.drawItems.Length == this.tabItemList.Count))
            {
                empty = this.drawItems[index].TabItemRectangle;
                empty.Inflate(-1, -1);
                empty.Size = new Size(this.reqTabItemSize - 2, this.reqTabItemSize - 2);
            }
            return(empty);
        }
        protected override void OnShowSmartTagVerbs(Point smartTagPoint)
        {
            if (this.itemPalette == null)
            {
                this.itemPalette                   = new ItemPalette();
                this.itemPalette.Closed           += new EventHandler(this.OnPaletteClosed);
                this.itemPalette.SelectionChanged += new SelectionChangeEventHandler <SelectionChangeEventArgs>(this.OnSmartAction);
            }
            this.itemPalette.SetFont(WorkflowTheme.CurrentTheme.AmbientTheme.Font);
            this.itemPalette.Items.Clear();
            foreach (ActivityDesignerVerb verb in this.SmartTagVerbs)
            {
                Image image = verb.Properties[DesignerUserDataKeys.Image] as Image;
                System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(verb.Id, image, verb.Text);
                item.UserData[DesignerUserDataKeys.DesignerVerb] = verb;
                this.itemPalette.Items.Add(item);
            }
            Point location = base.PointToScreen(smartTagPoint);

            this.itemPalette.Show(location);
        }
Ejemplo n.º 14
0
        public Rectangle GetItemBounds(System.Workflow.ComponentModel.Design.ItemInfo itemInfo)
        {
            int index = this.items.IndexOf(itemInfo);

            if (index < 0)
            {
                return(Rectangle.Empty);
            }
            if ((index < this.scrollMarker) || (index >= (this.scrollMarker + this.VisibleItemCount)))
            {
                return(Rectangle.Empty);
            }
            Rectangle stripRectangle = this.StripRectangle;
            Rectangle empty          = Rectangle.Empty;

            System.Drawing.Size itemMargin = this.ItemMargin;
            System.Drawing.Size itemSize   = this.ItemSize;
            index     -= this.scrollMarker;
            empty.X    = (stripRectangle.Left + (index * itemSize.Width)) + ((index + 1) * itemMargin.Width);
            empty.Y    = stripRectangle.Top + itemMargin.Height;
            empty.Size = itemSize;
            return(empty);
        }
Ejemplo n.º 15
0
        private Rectangle GetTabTextRectangle(System.Workflow.ComponentModel.Design.ItemInfo tabItemInfo)
        {
            int index = this.tabItemList.IndexOf(tabItemInfo);

            if (index < 0)
            {
                throw new ArgumentException(DR.GetString("ButtonInformationMissing", new object[0]));
            }
            Rectangle empty = Rectangle.Empty;

            if ((tabItemInfo.Text == null) || (this.drawItems.Length != this.tabItemList.Count))
            {
                return(empty);
            }
            empty = this.drawItems[index].TabItemRectangle;
            empty.Inflate(-1, -1);
            Rectangle tabImageRectangle = this.GetTabImageRectangle(tabItemInfo);

            if (!tabImageRectangle.IsEmpty)
            {
                if (this.orientation == Orientation.Horizontal)
                {
                    empty.X     += tabImageRectangle.Width + 1;
                    empty.Width -= tabImageRectangle.Width + 1;
                }
                else
                {
                    empty.Y      += tabImageRectangle.Height + 1;
                    empty.Height -= tabImageRectangle.Height + 1;
                }
            }
            if ((empty.Width > 0) && (empty.Height > 0))
            {
                return(empty);
            }
            return(Rectangle.Empty);
        }
        public Rectangle GetItemBounds(System.Workflow.ComponentModel.Design.ItemInfo itemInfo)
        {
            int index = this.items.IndexOf(itemInfo);

            if (((index < 0) || (index < this.scrollPosition)) || (index >= (this.scrollPosition + this.MaxVisibleItems)))
            {
                return(Rectangle.Empty);
            }
            Rectangle empty = Rectangle.Empty;

            index -= this.scrollPosition;
            if (this.orientation == Orientation.Horizontal)
            {
                empty.X = (this.bounds.Left + (index * this.itemSize.Width)) + ((index + 1) * this.margin.Width);
                empty.Y = this.bounds.Top + this.margin.Height;
            }
            else
            {
                empty.X = this.bounds.Left + this.margin.Width;
                empty.Y = (this.bounds.Top + (index * this.itemSize.Height)) + ((index + 1) * this.margin.Height);
            }
            empty.Size = this.itemSize;
            return(empty);
        }
Ejemplo n.º 17
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     if (this.drawItems.Length == this.tabItemList.Count)
     {
         e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
         System.Drawing.Color color  = System.Drawing.Color.FromArgb(0xff, 0xee, 0xc2);
         System.Drawing.Color color2 = System.Drawing.Color.FromArgb(0xff, 0xc0, 0x6f);
         if (SystemInformation.HighContrast)
         {
             color  = System.Drawing.Color.FromArgb(0xff - color.R, 0xff - color.G, 0xff - color.B);
             color2 = System.Drawing.Color.FromArgb(0xff - color2.R, 0xff - color2.G, 0xff - color2.B);
         }
         using (Brush brush = new SolidBrush(color))
         {
             using (Brush brush2 = new SolidBrush(color2))
             {
                 for (int i = 0; i < this.drawItems.Length; i++)
                 {
                     System.Workflow.ComponentModel.Design.ItemInfo tabItemInfo = this.tabItemList[i];
                     DrawTabItemStruct struct2          = this.drawItems[i];
                     Brush             control          = SystemBrushes.Control;
                     Rectangle         tabItemRectangle = struct2.TabItemRectangle;
                     if (this.selectedTab == i)
                     {
                         control = brush2;
                         e.Graphics.FillRectangle(control, tabItemRectangle);
                         e.Graphics.DrawRectangle(SystemPens.Highlight, tabItemRectangle);
                     }
                     else
                     {
                         Point pt = base.PointToClient(Control.MousePosition);
                         if (tabItemRectangle.Contains(pt))
                         {
                             control = brush;
                             e.Graphics.FillRectangle(control, tabItemRectangle);
                             e.Graphics.DrawRectangle(SystemPens.ControlDarkDark, tabItemRectangle);
                         }
                     }
                     Rectangle tabImageRectangle = this.GetTabImageRectangle(tabItemInfo);
                     if (!tabImageRectangle.IsEmpty)
                     {
                         e.Graphics.DrawImage(tabItemInfo.Image, tabImageRectangle);
                     }
                     Rectangle tabTextRectangle = this.GetTabTextRectangle(tabItemInfo);
                     if (!tabTextRectangle.IsEmpty)
                     {
                         StringFormat format = new StringFormat {
                             Alignment     = StringAlignment.Center,
                             LineAlignment = StringAlignment.Center,
                             Trimming      = StringTrimming.EllipsisCharacter
                         };
                         if (this.orientation == Orientation.Horizontal)
                         {
                             RectangleF layoutRectangle = new RectangleF((float)tabTextRectangle.X, (float)tabTextRectangle.Y, (float)tabTextRectangle.Width, (float)tabTextRectangle.Height);
                             e.Graphics.DrawString(tabItemInfo.Text, this.Font, SystemBrushes.ControlText, layoutRectangle, format);
                         }
                         else
                         {
                             using (Bitmap bitmap = new Bitmap(tabTextRectangle.Height, tabTextRectangle.Width, e.Graphics))
                             {
                                 using (Graphics graphics = Graphics.FromImage(bitmap))
                                 {
                                     graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
                                     graphics.FillRectangle(control, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
                                     graphics.DrawString(this.tabItemList[i].Text, this.Font, SystemBrushes.ControlText, new Rectangle(0, 0, bitmap.Width, bitmap.Height), format);
                                     bitmap.RotateFlip(RotateFlipType.Rotate90FlipNone);
                                     e.Graphics.DrawImage(bitmap, tabTextRectangle);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 18
0
 protected override void OnLayout(LayoutEventArgs levent)
 {
     base.OnLayout(levent);
     using (Graphics graphics = base.CreateGraphics())
     {
         this.drawItems = new DrawTabItemStruct[this.tabItemList.Count];
         int  num  = (this.orientation == Orientation.Horizontal) ? base.Width : base.Height;
         bool flag = false;
         if (num <= this.MinimumRequiredSize)
         {
             flag = true;
         }
         int num2 = 0;
         for (int i = 0; i < this.tabItemList.Count; i++)
         {
             int num4 = 0;
             System.Workflow.ComponentModel.Design.ItemInfo info = this.tabItemList[i];
             if (info.Image != null)
             {
                 num4++;
                 num4 += this.reqTabItemSize - 2;
             }
             if ((info.Text != null) && (info.Text.Length > 0))
             {
                 SizeF ef    = graphics.MeasureString(info.Text, this.Font);
                 int   width = Convert.ToInt32(Math.Ceiling((double)ef.Width));
                 this.drawItems[i].TextSize = new Size(width, Convert.ToInt32(Math.Ceiling((double)ef.Height)));
                 if (!flag)
                 {
                     num4 += this.drawItems[i].TextSize.Width + 1;
                 }
             }
             num4 += (num4 == 0) ? this.reqTabItemSize : 1;
             this.drawItems[i].TabItemRectangle = Rectangle.Empty;
             if (this.orientation == Orientation.Horizontal)
             {
                 this.drawItems[i].TabItemRectangle.X      = num2;
                 this.drawItems[i].TabItemRectangle.Y      = 0;
                 this.drawItems[i].TabItemRectangle.Width  = num4;
                 this.drawItems[i].TabItemRectangle.Height = this.reqTabItemSize;
             }
             else
             {
                 this.drawItems[i].TabItemRectangle.X      = 0;
                 this.drawItems[i].TabItemRectangle.Y      = num2;
                 this.drawItems[i].TabItemRectangle.Width  = this.reqTabItemSize;
                 this.drawItems[i].TabItemRectangle.Height = num4;
             }
             num2 += num4 + 1;
         }
         num2--;
         if (num2 > num)
         {
             int num5 = (int)Math.Ceiling((double)(((double)(num2 - num)) / ((double)Math.Max(1, this.tabItemList.Count))));
             num2 = 0;
             DrawTabItemStruct struct2 = this.drawItems[this.tabItemList.Count - 1];
             int num6 = (this.orientation == Orientation.Horizontal) ? (struct2.TabItemRectangle.Width - num5) : (struct2.TabItemRectangle.Height - num5);
             if (num6 < this.reqTabItemSize)
             {
                 num5 += (int)Math.Ceiling((double)(((double)(this.reqTabItemSize - num6)) / ((double)Math.Max(1, this.tabItemList.Count))));
             }
             for (int j = 0; j < this.tabItemList.Count; j++)
             {
                 if (this.orientation == Orientation.Horizontal)
                 {
                     this.drawItems[j].TabItemRectangle.X     -= num2;
                     this.drawItems[j].TabItemRectangle.Width -= num5;
                     if ((j == (this.tabItemList.Count - 1)) && (this.drawItems[j].TabItemRectangle.Width < this.reqTabItemSize))
                     {
                         this.drawItems[j].TabItemRectangle.Width = this.reqTabItemSize;
                     }
                 }
                 else
                 {
                     this.drawItems[j].TabItemRectangle.Y      -= num2;
                     this.drawItems[j].TabItemRectangle.Height -= num5;
                     if ((j == (this.tabItemList.Count - 1)) && (this.drawItems[j].TabItemRectangle.Height < this.reqTabItemSize))
                     {
                         this.drawItems[j].TabItemRectangle.Height = this.reqTabItemSize;
                     }
                 }
                 num2 += num5;
             }
         }
     }
 }
Ejemplo n.º 19
0
 internal StripItemSelectionGlyph(ActivityPreviewDesigner parentDesigner, System.Workflow.ComponentModel.Design.ItemInfo item)
 {
     this.parentDesigner = parentDesigner;
     this.item           = item;
 }
 protected override void OnShowSmartTagVerbs(Point smartTagPoint)
 {
     if (this.itemPalette == null)
     {
         this.itemPalette = new ItemPalette();
         this.itemPalette.Closed += new EventHandler(this.OnPaletteClosed);
         this.itemPalette.SelectionChanged += new SelectionChangeEventHandler<SelectionChangeEventArgs>(this.OnSmartAction);
     }
     this.itemPalette.SetFont(WorkflowTheme.CurrentTheme.AmbientTheme.Font);
     this.itemPalette.Items.Clear();
     foreach (ActivityDesignerVerb verb in this.SmartTagVerbs)
     {
         Image image = verb.Properties[DesignerUserDataKeys.Image] as Image;
         System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(verb.Id, image, verb.Text);
         item.UserData[DesignerUserDataKeys.DesignerVerb] = verb;
         this.itemPalette.Items.Add(item);
     }
     Point location = base.PointToScreen(smartTagPoint);
     this.itemPalette.Show(location);
 }
 public SelectionChangeEventArgs(System.Workflow.ComponentModel.Design.ItemInfo previousItem, System.Workflow.ComponentModel.Design.ItemInfo currentItem)
 {
     this.previousItem = previousItem;
     this.currentItem = currentItem;
 }
Ejemplo n.º 22
0
 public TabSelectionChangeEventArgs(System.Workflow.ComponentModel.Design.ItemInfo previousItem, System.Workflow.ComponentModel.Design.ItemInfo currentItem, Rectangle selectedTabBounds) : base(previousItem, currentItem)
 {
     this.selectedTabBounds = Rectangle.Empty;
     this.selectedTabBounds = selectedTabBounds;
 }
 protected override void OnContainedActivitiesChanged(ActivityCollectionChangeEventArgs listChangeArgs)
 {
     if (base.ActiveDesigner == this)
     {
         if (((listChangeArgs.Action == ActivityCollectionChangeAction.Add) && (listChangeArgs.AddedItems.Count > 0)) && !Helpers.IsAlternateFlowActivity(listChangeArgs.AddedItems[0]))
         {
             System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.AddedItems[0].GetHashCode());
             item.UserData[DesignerUserDataKeys.Activity] = listChangeArgs.AddedItems[0];
             if (listChangeArgs.Index < this.previewStrip.Items.Count)
             {
                 this.previewStrip.Items.Insert(listChangeArgs.Index, item);
             }
             else
             {
                 this.previewStrip.Items.Add(item);
             }
         }
         else if ((listChangeArgs.Action == ActivityCollectionChangeAction.Remove) && (listChangeArgs.RemovedItems.Count > 0))
         {
             int index = this.previewStrip.Items.IndexOf(new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.RemovedItems[0].GetHashCode()));
             if (index >= 0)
             {
                 this.previewStrip.Items.RemoveAt(index);
             }
         }
     }
     base.OnContainedActivitiesChanged(listChangeArgs);
 }
 internal StripItemSelectionGlyph(ActivityPreviewDesigner parentDesigner, System.Workflow.ComponentModel.Design.ItemInfo item)
 {
     this.parentDesigner = parentDesigner;
     this.item = item;
 }
Ejemplo n.º 25
0
 public SelectionChangeEventArgs(System.Workflow.ComponentModel.Design.ItemInfo previousItem, System.Workflow.ComponentModel.Design.ItemInfo currentItem)
 {
     this.previousItem = previousItem;
     this.currentItem  = currentItem;
 }
 protected override void Initialize(Activity activity)
 {
     base.Initialize(activity);
     this.ShowPreview = true;
     CompositeActivity activity2 = base.Activity as CompositeActivity;
     if (activity2 != null)
     {
         foreach (Activity activity3 in activity2.Activities)
         {
             if (!Helpers.IsAlternateFlowActivity(activity3))
             {
                 System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(activity3.GetHashCode());
                 item.UserData[DesignerUserDataKeys.Activity] = activity3;
                 this.previewStrip.Items.Add(item);
             }
         }
     }
     ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService;
     if (service != null)
     {
         service.SelectionChanged += new EventHandler(this.OnSelectionChanged);
     }
 }