当前位置: 首页>>代码示例>>C#>>正文


C# ControlPointCapabilities类代码示例

本文整理汇总了C#中ControlPointCapabilities的典型用法代码示例。如果您正苦于以下问题:C# ControlPointCapabilities类的具体用法?C# ControlPointCapabilities怎么用?C# ControlPointCapabilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ControlPointCapabilities类属于命名空间,在下文中一共展示了ControlPointCapabilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability) {
			switch (controlPointId) {
				case TopCenterControlPoint:
				case MiddleLeftControlPoint:
				case MiddleRightControlPoint:
				case BottomCenterControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Resize) != 0 || ((controlPointCapability & ControlPointCapabilities.Connect) != 0 && IsConnectionPointEnabled(controlPointId)));
				default:
					return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:12,代码来源:FlowChartShapes.cs

示例2: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			if (controlPointId == controlPoints.Length) {
				return ((controlPointCapability & ControlPointCapabilities.Rotate) > 0
				        || (controlPointCapability & ControlPointCapabilities.Reference) > 0
				        ||
				        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 && IsConnectionPointEnabled(controlPointId)));
			}
			else if (controlPointId >= 1) {
				return ((controlPointCapability & ControlPointCapabilities.Resize) > 0
				        ||
				        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 && IsConnectionPointEnabled(controlPointId)));
			}
			else
				return base.HasControlPointCapability(controlPointId, controlPointCapability);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:18,代码来源:Polygone.cs

示例3: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			switch (controlPointId) {
				case ControlPoint1:
				case ControlPoint2:
				case ControlPoint3:
					return ((controlPointCapability & ControlPointCapabilities.Resize) > 0
					        ||
					        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 &&
					         IsConnectionPointEnabled(controlPointId)));
				case RotateControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Rotate) > 0
					        || (controlPointCapability & ControlPointCapabilities.Reference) > 0
					        ||
					        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 &&
					         IsConnectionPointEnabled(controlPointId)));
				default:
					return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:22,代码来源:TriangleBase.cs

示例4: FindNearestControlPoint

		/// <override></override>
		public override ControlPointId FindNearestControlPoint(int x, int y, int distance,
		                                                       ControlPointCapabilities controlPointCapability)
		{
			if ((controlPointCapability & ControlPointCapabilities.Reference) > 0) {
				if (Geometry.DistancePointPoint(x, y, X, Y) <= distance)
					return ControlPointId.Reference;
			}
			else if ((controlPointCapability & ControlPointCapabilities.Rotate) > 0) {
				if (Geometry.DistancePointPoint(x, y, RotatePoint.X, RotatePoint.Y) <= distance)
					return RotatePointId;
			}
			return ControlPointId.None;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:14,代码来源:ShapeGroup.cs

示例5: HitTest

		/// <override></override>
		public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
		{
			//if ((controlPointCapability & ControlPointCapabilities.Reference) > 0)
			//   if (Geometry.DistancePointPoint(X, Y, x, y) <= distance)
			//      return true;
			if ((controlPointCapability & ControlPointCapabilities.Rotate) > 0) {
				if (Geometry.DistancePointPoint(RotatePoint.X, RotatePoint.Y, x, y) <= range)
					return RotatePointId;
				controlPointCapability ^= ControlPointCapabilities.Rotate;
			}
			foreach (Shape shape in children) {
				ControlPointId pointId = shape.HitTest(x, y, controlPointCapability, range);
				//if (pointId != ControlPointId.None) return pointId;

				// All control points but the rotate point are deactivated
				if (pointId != ControlPointId.None) return ControlPointId.Reference;
			}
			return ControlPointId.None;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:20,代码来源:ShapeGroup.cs

示例6: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     switch (controlPointId) {
         case TopLeftConnectionPoint:
         case TopRightConnectionPoint:
         case BottomLeftConnectionPoint:
         case BottomRightConnectionPoint:
             return ((controlPointCapability & ControlPointCapabilities.Connect) != 0 && IsConnectionPointEnabled(controlPointId));
         default:
             return base.HasControlPointCapability(controlPointId, controlPointCapability);
     }
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:13,代码来源:FlowChartShapes.cs

示例7: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     if (controlPointId == ControlPointId.Reference)
         return (controlPointCapability & ControlPointCapabilities.Connect) != 0;
     else return base.HasControlPointCapability(controlPointId, controlPointCapability);
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:7,代码来源:PathBasedShape.cs

示例8: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     //if (ImageLayout == ImageLayoutMode.Original) {
     //    if ((controlPointCapability & ControlPointCapabilities.Glue) != 0)
     //        return false;
     //    if ((controlPointCapability & ControlPointCapabilities.Connect) != 0 ) {
     //        return (controlPointId != RotateControlPointId && IsConnectionPointEnabled(controlPointId));
     //    }
     //    if ((controlPointCapability & ControlPointCapabilities.Reference) != 0) {
     //        if (controlPointId == RotateControlPointId || controlPointId == ControlPointId.Reference)
     //            return true;
     //    }
     //    if ((controlPointCapability & ControlPointCapabilities.Rotate) != 0) {
     //        if (controlPointId == RotateControlPointId)
     //            return true;
     //    }
     return base.HasControlPointCapability(controlPointId, controlPointCapability);
     //} else return base.HasControlPointCapability(controlPointId, controlPointCapability);
 }
开发者ID:alexdoan102,项目名称:CustomPicture-NShape,代码行数:20,代码来源:CustomPictureBase.cs

示例9: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     switch (controlPointId) {
         case TopLeftControlPoint:
         case TopCenterControlPoint:
         case TopRightControlPoint:
         case MiddleLeftControlPoint:
         case MiddleRightControlPoint:
         case BottomLeftControlPoint:
         case BottomCenterControlPoint:
         case BottomRightControlPoint:
             return (controlPointCapability & ControlPointCapabilities.Resize) != 0;
         case MiddleCenterControlPoint:
         case ControlPointId.Reference:
             return ((controlPointCapability & ControlPointCapabilities.Rotate) != 0
                 || (controlPointCapability & ControlPointCapabilities.Reference) != 0
                 || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
                     && IsConnectionPointEnabled(controlPointId)));
         default:
             return false;
     }
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:23,代码来源:SoftwareArchitectureShapes.cs

示例10: HitTest

 ///// <summary>Overriden method. Check base class for documentation.</summary>
 //public override Point CalculateConnectionFoot(int x1, int y1, int x2, int y2) {
 //    return CalculateConnectionFoot(x1, y1);
 //}
 /// <summary>Overriden method. Check base class for documentation.</summary>
 public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
 {
     ControlPointId result = ControlPointId.None;
     //
     // We first search for a hit control point
     for (int cpIdx = 0; cpIdx < ControlPointCount; ++cpIdx) {
         // Get positions of the current control points and test on hit.
         LineControlPoint ctrlPoint = GetControlPoint(cpIdx);
         Point currPos = ctrlPoint.GetPosition();
         if (Geometry.DistancePointPoint(x, y, currPos.X, currPos.Y) <= range) {
             if (HasControlPointCapability(ctrlPoint.Id, controlPointCapability))
                 result = GetControlPointId(cpIdx);
             break;
         }
     }
     if (result == ControlPointId.None) {
         int lineRange = (int)Math.Ceiling(LineStyle.LineWidth / 2f) + 1;
         Point lastKnee;
         int cpIdx = -1;
         FindNextKnee(ref cpIdx, out lastKnee);
         Point knee;
         while (FindNextKnee(ref cpIdx, out knee)) {
             if (Geometry.DistancePointLine(x, y, lastKnee.X, lastKnee.Y, knee.X, knee.Y, true) <= lineRange) {
                 result = ControlPointId.Reference;
                 break;
             }
             lastKnee = knee;
         }
     }
     return result;
 }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:36,代码来源:RectangularLineBase.cs

示例11: ReferenceControlPointHasCapability

 protected override bool ReferenceControlPointHasCapability(ControlPointCapabilities controlPointCapability)
 {
     return (controlPointCapability & ControlPointCapabilities.Reference) > 0 ||
            (controlPointCapability & ControlPointCapabilities.Connect) > 0;
 }
开发者ID:naztrain,项目名称:vixen,代码行数:5,代码来源:ConfigFiltersAndPatching-Shapes.cs

示例12: HasControlPointCapability

        public override bool HasControlPointCapability(ControlPointId controlPointId,
            ControlPointCapabilities controlPointCapability)
        {
            if (controlPointId == ControlPointId.None || controlPointId == ControlPointId.Any)
                return false;

            // all control points have at least the 'none' capability. Hopefully, they might even have more...
            if (controlPointCapability == ControlPointCapabilities.None)
                return true;

            int index = GetControlPointIndex(controlPointId);
            if (index > 0 && index <= InputCount + OutputCount) {
                return ((controlPointCapability & ControlPointCapabilities.Connect) > 0 ||
                        (controlPointCapability & ControlPointCapabilities.Resize) > 0);
            }

            if (controlPointId == ControlPointId.Reference || index == 0) {
                return ReferenceControlPointHasCapability(controlPointCapability);
            }

            // default to any other control points not having any capabilities (shouldn't be any left, really)
            return false;
        }
开发者ID:naztrain,项目名称:vixen,代码行数:23,代码来源:ConfigFiltersAndPatching-Shapes.cs

示例13: FindShapesSortedByZOrder

		public IEnumerable<Shape> FindShapesSortedByZOrder(IDiagramPresenter diagramPresenter, int x, int y,
		                                                   ControlPointCapabilities pointCapabilities, int distance)
		{
			return FindVisibleShapes(diagramPresenter, x, y, pointCapabilities, distance).OrderByDescending(s => s.ZOrder);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:5,代码来源:ConfigFiltersAndPatching-Tools.cs

示例14: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			switch (controlPointId) {
				case ControlPointId.Reference:
				case RotatePointControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Reference) != 0
					        || (controlPointCapability & ControlPointCapabilities.Rotate) != 0
					        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
					            && IsConnectionPointEnabled(controlPointId)));
				default:
					if (controlPointId > 0 && controlPointId < RotatePointControlPoint)
						return ((controlPointCapability & ControlPointCapabilities.Resize) != 0
						        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
						            && IsConnectionPointEnabled(controlPointId)));
					else
						return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:20,代码来源:RectangleShape.cs

示例15: HitTest

 /// <override></override>
 public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
 {
     return base.HitTest(x, y, controlPointCapability, range);
 }
开发者ID:alexdoan102,项目名称:CustomPicture-NShape,代码行数:5,代码来源:CustomPictureBase.cs


注:本文中的ControlPointCapabilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。