當前位置: 首頁>>代碼示例>>C#>>正文


C# Design.ActivityDesigner類代碼示例

本文整理匯總了C#中System.Workflow.ComponentModel.Design.ActivityDesigner的典型用法代碼示例。如果您正苦於以下問題:C# ActivityDesigner類的具體用法?C# ActivityDesigner怎麽用?C# ActivityDesigner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActivityDesigner類屬於System.Workflow.ComponentModel.Design命名空間,在下文中一共展示了ActivityDesigner類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetGlyphs

 /// <summary>
 /// Gets the glyphs for the associated activity designer
 /// </summary>
 /// <param name="activityDesigner"></param>
 /// <returns></returns>
 public ActivityDesignerGlyphCollection GetGlyphs(ActivityDesigner activityDesigner)
 {
     ActivityDesignerGlyphCollection glyphs = new ActivityDesignerGlyphCollection();
     //The glyph position indicates how far down the glyph is drawn
     int glyphPosition = -1;
     string validationError = string.Empty;            
     if (profileManager.IsActivityValid(activityDesigner.Activity, out validationError))
     {
         //Add an error glyph if the selected activity is not configured correctly
         ++glyphPosition;
         glyphs.Add(new ErrorActivityGlyph(validationError));
     }
     if (profileManager.IsTracked(activityDesigner.Activity))
     {
         //Add the glyph for the trackpoint
         glyphs.Add(new TrackedActivityGlyph(++glyphPosition, redPin));
     }
     if (profileManager.IsMatchedByDerivedTrackPoint(activityDesigner.Activity))
     {
         //Add faded derive match glyph
         glyphs.Add(new TrackedActivityGlyph(++glyphPosition, fadedRedPin));
     }
     string annotation = profileManager.GetAnnotation(activityDesigner.Activity);
     if (annotation != null)
     {
         //If an annotation exists, use the tooltip via the description.
         activityDesigner.Activity.Description = annotation;                
     }
     return glyphs;
 }
開發者ID:spzenk,項目名稱:sfdocsamples,代碼行數:35,代碼來源:TrackingProfileGlyph.cs

示例2: OnPaint

 protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
 {
     Rectangle bounds = GetBounds(designer, activated);
     graphics.FillRectangle(AmbientTheme.FadeBrush, bounds);
     graphics.FillRectangle(ambientTheme.CommentIndicatorBrush, bounds);
     graphics.DrawRectangle(ambientTheme.CommentIndicatorPen, bounds);
 }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:7,代碼來源:CommentGlyph.cs

示例3: GetGrabHandles

        public virtual Rectangle[] GetGrabHandles(ActivityDesigner designer) 
        {
            Size selectionSize = WorkflowTheme.CurrentTheme.AmbientTheme.SelectionSize;
            Size grabHandleSize = new Size(selectionSize.Width, selectionSize.Height);
            Rectangle selectionRect = GetBounds(designer, false);
            selectionRect.Inflate(selectionSize.Width, selectionSize.Height);

            //we need grab handles only in case this activity is an immediate child of a free-form activity
            //otherwise, no grab handles

            ActivityDesigner parentDesigner = designer.ParentDesigner;
            Rectangle[] grabHandles = null;
            if (parentDesigner != null && parentDesigner is FreeformActivityDesigner)
            {
                grabHandles = new Rectangle[8];
                grabHandles[0] = new Rectangle(selectionRect.Location, grabHandleSize);
                grabHandles[1] = new Rectangle(new Point(selectionRect.Left + (selectionRect.Width - grabHandleSize.Width) / 2, selectionRect.Top), grabHandleSize);
                grabHandles[2] = new Rectangle(selectionRect.Right - grabHandleSize.Width, selectionRect.Top, grabHandleSize.Width, grabHandleSize.Height);
                grabHandles[3] = new Rectangle(new Point(selectionRect.Right - grabHandleSize.Width, selectionRect.Top + (selectionRect.Height - grabHandleSize.Height) / 2), grabHandleSize);
                grabHandles[4] = new Rectangle(selectionRect.Right - grabHandleSize.Width, selectionRect.Bottom - grabHandleSize.Height, grabHandleSize.Width, grabHandleSize.Height);
                grabHandles[5] = new Rectangle(new Point(selectionRect.Left + (selectionRect.Width - grabHandleSize.Width) / 2, selectionRect.Bottom - grabHandleSize.Height), grabHandleSize);
                grabHandles[6] = new Rectangle(selectionRect.Left, selectionRect.Bottom - grabHandleSize.Height, grabHandleSize.Width, grabHandleSize.Height);
                grabHandles[7] = new Rectangle(new Point(selectionRect.Left, selectionRect.Top + (selectionRect.Height - grabHandleSize.Height) / 2), grabHandleSize);
                return grabHandles;
            }
            else
            {
                grabHandles = new Rectangle[1];
                grabHandles[0] = new Rectangle(selectionRect.Location, grabHandleSize);
            }

            return grabHandles;            
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:33,代碼來源:SelectionGlyph.cs

示例4: GetSizingEdge

 private DesignerEdges GetSizingEdge(ActivityDesigner designer, Point point)
 {
     DesignerEdges none = DesignerEdges.None;
     Size selectionSize = WorkflowTheme.CurrentTheme.AmbientTheme.SelectionSize;
     Rectangle bounds = designer.Bounds;
     Point[] line = new Point[] { new Point(bounds.Left, bounds.Top), new Point(bounds.Left, bounds.Bottom) };
     if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, line)) <= (selectionSize.Width + 1))
     {
         none |= DesignerEdges.Left;
     }
     Point[] pointArray2 = new Point[] { new Point(bounds.Left, bounds.Top), new Point(bounds.Right, bounds.Top) };
     if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, pointArray2)) <= (selectionSize.Height + 1))
     {
         none |= DesignerEdges.Top;
     }
     Point[] pointArray3 = new Point[] { new Point(bounds.Right, bounds.Top), new Point(bounds.Right, bounds.Bottom) };
     if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, pointArray3)) <= (selectionSize.Width + 1))
     {
         none |= DesignerEdges.Right;
     }
     Point[] pointArray4 = new Point[] { new Point(bounds.Left, bounds.Bottom), new Point(bounds.Right, bounds.Bottom) };
     if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, pointArray4)) <= (selectionSize.Height + 1))
     {
         none |= DesignerEdges.Bottom;
     }
     return none;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:27,代碼來源:ResizingMessageFilter.cs

示例5: OnPaint

 protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
 {
     Bitmap bitmap = Resources.Executing;
     bitmap.MakeTransparent(Color.FromArgb(0, 255, 255));
     if (bitmap != null)
         graphics.DrawImage(bitmap, GetBounds(designer, activated), new Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel);
 }
開發者ID:spzenk,項目名稱:sfdocsamples,代碼行數:7,代碼來源:DesignerGlyphProvider.cs

示例6: DesignerLayoutConnectionPoint

            public DesignerLayoutConnectionPoint(ActivityDesigner associatedDesigner, int connectionIndex, CompositeActivity eventHandler, DesignerEdges designerEdges)
                : base(associatedDesigner, designerEdges, connectionIndex)
            {
                Debug.Assert(designerEdges == DesignerEdges.Left || designerEdges == DesignerEdges.Right);
                _eventHandler = eventHandler;
                _designerEdges = designerEdges;

            }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:8,代碼來源:StateDesigner.Layouts.cs

示例7: OnPaint

 protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
 {
     if (!this.GetBounds(designer, activated).Size.IsEmpty)
     {
         bool roundEdges = (designer.DesignerTheme.DesignerGeometry == DesignerGeometry.RoundedRectangle) && !designer.IsRootDesigner;
         ActivityDesignerPaint.DrawDropShadow(graphics, designer.Bounds, designer.DesignerTheme.BorderPen.Color, 4, LightSourcePosition.Top | LightSourcePosition.Left, 0.5f, roundEdges);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:ShadowGlyph.cs

示例8: DesignerView

        public DesignerView(int viewId, string text, Image image, ActivityDesigner associatedDesigner)
            : this(viewId, text, image)
        {
            if (associatedDesigner == null)
                throw new ArgumentNullException("associatedDesigner");

            this.designer = associatedDesigner;
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:8,代碼來源:DesignerView.cs

示例9: GetBounds

 public virtual Rectangle GetBounds(ActivityDesigner designer, bool activated)
 {
     if (designer == null)
     {
         throw new ArgumentNullException("designer");
     }
     return designer.Bounds;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:DesignerGlyph.cs

示例10: GetBounds

            public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
            {
                if (designer == null)
                    throw new ArgumentNullException("designer");

                Rectangle bounds = _layout.Bounds;
                return bounds;
            }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:StateDesigner.CommentLayoutGlyph.cs

示例11: GetBounds

        public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
        {
            if (designer == null)
                throw new ArgumentNullException("designer");

            Rectangle rectangle = designer.Bounds;
            rectangle.Inflate(WorkflowTheme.CurrentTheme.AmbientTheme.SelectionSize.Width / 2, WorkflowTheme.CurrentTheme.AmbientTheme.SelectionSize.Height / 2);
            return rectangle;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:9,代碼來源:SelectionGlyph.cs

示例12: ActivityDesignerAccessibleObject

        /// <summary>
        /// Constructs the accessibility class for ActivityDesigner
        /// </summary>
        /// <param name="activityDesigner">ActivityDesigner associated with accessiblity object</param>
        public ActivityDesignerAccessibleObject(ActivityDesigner activityDesigner)
        {
            if (activityDesigner == null)
                throw new ArgumentNullException("activityDesigner");
            if (activityDesigner.Activity == null)
                throw new ArgumentException(DR.GetString(DR.DesignerNotInitialized), "activityDesigner");

            this.activityDesigner = activityDesigner;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:13,代碼來源:ActivityDesignerAccessibleObject.cs

示例13: HitTestInfo

 public HitTestInfo(ActivityDesigner designer, HitTestLocations location)
 {
     if (designer == null)
     {
         throw new ArgumentNullException("designer");
     }
     this.activityDesigner = designer;
     this.location = location;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:HitTestInfo.cs

示例14: OnPaint

 protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
 {
     Rectangle bounds = GetBounds(designer, activated);
     if (!bounds.Size.IsEmpty)
     {
         bool drawRounded = (designer.DesignerTheme.DesignerGeometry == DesignerGeometry.RoundedRectangle && !designer.IsRootDesigner);
         ActivityDesignerPaint.DrawDropShadow(graphics, designer.Bounds, designer.DesignerTheme.BorderPen.Color, AmbientTheme.DropShadowWidth, LightSourcePosition.Left | LightSourcePosition.Top, 0.5f, drawRounded);
     }
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:9,代碼來源:ShadowGlyph.cs

示例15: OnActivate

 protected override void OnActivate(ActivityDesigner designer)
 {
     if ((designer != null) && (designer.DesignerActions.Count > 0))
     {
         Rectangle bounds = this.GetBounds(designer, false);
         Point location = designer.ParentView.LogicalPointToScreen(new Point(bounds.Left, bounds.Bottom));
         DesignerHelpers.ShowDesignerVerbs(designer, location, DesignerHelpers.GetDesignerActionVerbs(designer, designer.DesignerActions));
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:ConfigErrorGlyph.cs


注:本文中的System.Workflow.ComponentModel.Design.ActivityDesigner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。