本文整理汇总了C#中ArrowDirection类的典型用法代码示例。如果您正苦于以下问题:C# ArrowDirection类的具体用法?C# ArrowDirection怎么用?C# ArrowDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrowDirection类属于命名空间,在下文中一共展示了ArrowDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToolStripArrowRenderEventArgs
/// <include file='doc\ToolStripArrowRenderEventArgs.uex' path='docs/doc[@for="ToolStripArrowRenderEventArgs.ToolStripArrowRenderEventArgs"]/*' />
public ToolStripArrowRenderEventArgs(Graphics g, ToolStripItem toolStripItem, Rectangle arrowRectangle, Color arrowColor, ArrowDirection arrowDirection) {
this.item = toolStripItem;
this.graphics = g;
this.arrowRect = arrowRectangle;
this.defaultArrowColor = arrowColor;
this.arrowDirection = arrowDirection;
}
示例2: DrawDisabled
protected override void DrawDisabled(Graphics g, ArrowDirection direction)
{
g.DrawEllipse(_disabledPen, _circleRect);
if (direction == ArrowDirection.Right)
g.MultiplyTransform(new Matrix(-1, 0, 0, 1, 23, 0));
g.DrawPath(_disabledArrowPen, _arrowPath);
}
示例3: CheckSolution
public override void CheckSolution(ArrowDirection arrowDirection)
{
if (arrowDirection == ArrowDirection.UP)
{
this.correct = true;
}
}
示例4: MoveModelToView
public override void MoveModelToView(ArchetypeData model)
{
base.MoveModelToView(model);
var m = model as ArrowWorldObjectArchetypeData;
this.ArrowDirection = m.ArrowDirection;
}
示例5: DrawHover
protected override void DrawHover(Graphics g, ArrowDirection direction)
{
g.FillEllipse(_hoverBrush,
new RectangleF(_circleRect.X - 0.5f, _circleRect.Y - 0.5f, _circleRect.Width + 1,
_circleRect.Height + 1));
if (direction == ArrowDirection.Right)
g.MultiplyTransform(new Matrix(-1, 0, 0, 1, 23, 0));
g.DrawPath(_hoverArrowPen, _arrowPath);
}
示例6: ToolStripArrowRenderEventArgs
public ToolStripArrowRenderEventArgs (Graphics g, ToolStripItem toolStripItem, Rectangle arrowRectangle, Color arrowColor, ArrowDirection arrowDirection)
: base ()
{
this.graphics = g;
this.tool_strip_item = toolStripItem;
this.arrow_rectangle = arrowRectangle;
this.arrow_color = arrowColor;
this.arrow_direction = arrowDirection;
}
示例7: UpdateShape
protected override void UpdateShape(ArrowDirection pointerDirection)
{
switch (pointerDirection)
{
case ArrowDirection.Left: ShapePathData = Shapes.RoundedPointerLeft; break;
case ArrowDirection.Right: ShapePathData = Shapes.RoundedPointerRight; break;
case ArrowDirection.Up: ShapePathData = Shapes.RoundedPointerUp; break;
case ArrowDirection.Down: ShapePathData = Shapes.RoundedPointerDown; break;
default: throw new NotSupportedException(PointerDirection.ToString());
}
}
示例8: PaintScrollBarArrowEventArgs
public PaintScrollBarArrowEventArgs(
Graphics graphics,
Rectangle arrowRect,
ControlState controlState,
ArrowDirection arrowDirection,
Orientation orientation)
: this(graphics,
arrowRect,
controlState,
arrowDirection,
orientation,
true)
{
}
示例9: CheckSolution
public override void CheckSolution(ArrowDirection arrowDirection)
{
orderPressed.Add(arrowDirection);
//left, up, right, down
for (int i = 0; i < orderPressed.Count; i++)
{
switch (i)
{
case 0:
if (orderPressed[i] == ArrowDirection.LEFT)
{
Debug.Log("Left");
}
else
orderPressed.Clear();
break;
case 1:
if (orderPressed[i] == ArrowDirection.UP)
{
Debug.Log("Up");
}
else
orderPressed.Clear();
break;
case 2:
if (orderPressed[i] == ArrowDirection.RIGHT)
{
Debug.Log("Right");
}
else
orderPressed.Clear();
break;
case 3:
if (orderPressed[i] == ArrowDirection.DOWN)
{
this.correct = true;
}
else
orderPressed.Clear();
break;
default:
break;
}
}
}
示例10: Draw
public void Draw(Graphics g, ArrowDirection direction, ButtonState state)
{
switch (state)
{
case ButtonState.Hover:
DrawHover(g, direction);
break;
case ButtonState.Disabled:
DrawDisabled(g, direction);
break;
case ButtonState.Pressed:
DrawPressed(g, direction);
break;
default:
DrawNormal(g, direction);
break;
}
}
示例11: AddSegment
private static void AddSegment(GraphicsPath path, int radius, Point p1, Point p2, bool roundP1, bool roundP2, ArrowDirection direction)
{
if (roundP1)
{
switch (direction)
{
case ArrowDirection.Left:
p1.X -= radius;
goto Label_005C;
case ArrowDirection.Up:
p1.Y -= radius;
goto Label_005C;
case ArrowDirection.Down:
p1.Y += radius;
goto Label_005C;
}
p1.X += radius;
}
Label_005C:
if (roundP2)
{
switch (direction)
{
case ArrowDirection.Left:
p2.X += radius;
goto Label_00B8;
case ArrowDirection.Up:
p2.Y += radius;
goto Label_00B8;
case ArrowDirection.Down:
p2.Y -= radius;
goto Label_00B8;
}
p2.X -= radius;
}
Label_00B8:
path.AddLine(p1, p2);
}
示例12: RenderArrowInternal
internal static void RenderArrowInternal(
Graphics g,
Rectangle dropDownRect,
ArrowDirection direction,
Brush brush)
{
Point point = new Point(
dropDownRect.Left + (dropDownRect.Width / 2),
dropDownRect.Top + (dropDownRect.Height / 2));
Point[] points = null;
switch (direction)
{
case ArrowDirection.Left:
points = new Point[] {
new Point(point.X + 1, point.Y - 4),
new Point(point.X + 1, point.Y + 4),
new Point(point.X - 2, point.Y) };
break;
case ArrowDirection.Up:
points = new Point[] {
new Point(point.X - 4, point.Y + 1),
new Point(point.X + 4, point.Y + 1),
new Point(point.X, point.Y - 2) };
break;
case ArrowDirection.Right:
points = new Point[] {
new Point(point.X - 2, point.Y - 4),
new Point(point.X - 2, point.Y + 4),
new Point(point.X + 1, point.Y) };
break;
default:
points = new Point[] {
new Point(point.X - 4, point.Y - 1),
new Point(point.X + 4, point.Y - 1),
new Point(point.X, point.Y + 2) };
break;
}
g.FillPolygon(brush, points);
}
示例13: AddRoundedCorner
private static void AddRoundedCorner(GraphicsPath path, int diameter, Point midPoint, ArrowDirection direction1, ArrowDirection direction2)
{
switch (direction1)
{
case ArrowDirection.Left:
if (direction2 != ArrowDirection.Down)
{
path.AddArc(midPoint.X, midPoint.Y - diameter, diameter, diameter, 90f, 90f);
return;
}
path.AddArc(midPoint.X, midPoint.Y, diameter, diameter, 270f, -90f);
return;
case ArrowDirection.Up:
if (direction2 != ArrowDirection.Left)
{
path.AddArc(midPoint.X, midPoint.Y, diameter, diameter, 180f, 90f);
return;
}
path.AddArc(midPoint.X - diameter, midPoint.Y, diameter, diameter, 0f, -90f);
return;
case ArrowDirection.Right:
if (direction2 == ArrowDirection.Down)
{
path.AddArc(midPoint.X - diameter, midPoint.Y, diameter, diameter, 270f, 90f);
return;
}
path.AddArc(midPoint.X - diameter, midPoint.Y - diameter, diameter, diameter, 90f, -90f);
return;
}
if (direction2 == ArrowDirection.Left)
{
path.AddArc(midPoint.X - diameter, midPoint.Y - diameter, diameter, diameter, 0f, 90f);
}
else
{
path.AddArc(midPoint.X, midPoint.Y - diameter, diameter, diameter, 180f, -90f);
}
}
示例14: CreateTrianglePath
/// <summary>
/// Creates a triangle based on the size and bounds sectors
/// </summary>
/// <param name="Bounds">The area which the triangle is confined to</param>
/// <param name="Size">The size of the triangle</param>
/// <param name="Direction">The direction which the triangle is pointing</param>
/// <returns></returns>
private GraphicsPath CreateTrianglePath(Rectangle Bounds, Int32 Size, ArrowDirection Direction)
{
GraphicsPath Result = new GraphicsPath();
int x, y, c, j;
if (Direction == ArrowDirection.Left || Direction == ArrowDirection.Right)
{
x = Bounds.Right - (Bounds.Width - Size) / 2;
y = Bounds.Y + Bounds.Height / 2;
c = Size;
j = 0;
}
else
{
x = Bounds.X + Bounds.Width / 2;
y = Bounds.Bottom - ((Bounds.Height - (Size - 1)) / 2);
c = Size - 1;
j = Size - 2;
}
switch (Direction)
{
case ArrowDirection.Right:
Result.AddLine(x, y, x - c, y - c);
Result.AddLine(x - c, y - c, x - c, y + c);
Result.AddLine(x - c, y + c, x, y);
break;
case ArrowDirection.Down:
Result.AddLine(x + j, y - j, x - j, y - j);
Result.AddLine(x - j, y - j, x, y);
Result.AddLine(x, y, x + j, y - j);
break;
case ArrowDirection.Left:
Result.AddLine(x - c, y, x, y - c);
Result.AddLine(x, y - c, x, y + c);
Result.AddLine(x, y + c, x - c, y);
break;
}
return Result;
}
示例15: GetNextItem
internal virtual ToolStripItem GetNextItem(ToolStripItem start, ArrowDirection direction, bool rtlAware)
{
if (rtlAware && (this.RightToLeft == RightToLeft.Yes))
{
if (direction == ArrowDirection.Right)
{
direction = ArrowDirection.Left;
}
else if (direction == ArrowDirection.Left)
{
direction = ArrowDirection.Right;
}
}
return this.GetNextItem(start, direction);
}