本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例9: GetBounds
public virtual Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
if (designer == null)
{
throw new ArgumentNullException("designer");
}
return designer.Bounds;
}
示例10: GetBounds
public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
if (designer == null)
throw new ArgumentNullException("designer");
Rectangle bounds = _layout.Bounds;
return bounds;
}
示例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;
}
示例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;
}
示例13: HitTestInfo
public HitTestInfo(ActivityDesigner designer, HitTestLocations location)
{
if (designer == null)
{
throw new ArgumentNullException("designer");
}
this.activityDesigner = designer;
this.location = location;
}
示例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);
}
}
示例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));
}
}