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


C# ControlPointId类代码示例

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


ControlPointId类属于命名空间,在下文中一共展示了ControlPointId类的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: CalcLineCapAngle

        /// <summary>
        /// Calculates the angle of the line cap (this is usually the angle between the line's end vertex the its predecessor).
        /// If the predecessor of the line's end vertex is inside the line cap, the intersection point between the line cap and
        /// the rest of the line is calculated, like GDI+ does.
        /// </summary>
        public static float CalcLineCapAngle(Point[] points, ControlPointId pointId, Pen pen)
        {
            if (points == null) throw new ArgumentNullException("points");
            if (points.Length < 2) throw new ArgumentException("Parameter points must have at least 2 elements.");
            if (pointId != ControlPointId.FirstVertex && pointId != ControlPointId.LastVertex) throw new ArgumentException("pointId");
            float result = float.NaN;

            // Get required infos: Size of the cap, start point and point processing direction
            int startIdx = -1, step = 0;
            float capInset = 0;
            if (pointId == ControlPointId.FirstVertex) {
                startIdx = 0;
                step = 1;
                if (pen.StartCap == LineCap.Custom)
                    capInset = pen.CustomStartCap.BaseInset * pen.Width;
            } else if (pointId == ControlPointId.LastVertex) {
                startIdx = points.Length - 1;
                step = -1;
                if (pen.EndCap == LineCap.Custom)
                    capInset = pen.CustomEndCap.BaseInset * pen.Width;
            } else throw new NotSupportedException();
            // Store point where the line cap is located
            Point capPoint = points[startIdx];
            int maxIdx = points.Length - 1;
            int destIdx = startIdx + step;
            // Find first point *outside* the cap's area
            while (Geometry.DistancePointPoint(capPoint, points[destIdx]) < capInset && (destIdx > 0 && destIdx < maxIdx)) {
                startIdx = destIdx;
                destIdx += step;
            }
            // Calculate cap angle
            PointF p = Geometry.IntersectCircleWithLine(capPoint, capInset, points[startIdx], points[destIdx], true);
            if (Geometry.IsValid(p) && Geometry.LineContainsPoint(points[startIdx], points[destIdx], false, p.X, p.Y, 1))
                result = Geometry.RadiansToDegrees(Geometry.Angle(capPoint, p));
            if (float.IsNaN(result))
                result = Geometry.RadiansToDegrees(Geometry.Angle(points[startIdx], points[destIdx]));
            Debug.Assert(!float.IsNaN(result));
            return result;
        }
开发者ID:LudovicT,项目名称:NShape,代码行数:44,代码来源:ShapeUtils.cs

示例5: AttachGluePointToConnectionPoint

		/// <override></override>
		protected internal override void AttachGluePointToConnectionPoint(ControlPointId ownPointId, Shape otherShape,
		                                                                  ControlPointId gluePointId)
		{
			if (ownPointId != ControlPointId.Reference &&
			    !HasControlPointCapability(ownPointId, ControlPointCapabilities.Connect))
				throw new NShapeException(string.Format("{0}'s point {1} has to be a connection point.", Type.Name, ownPointId));
			if (!otherShape.HasControlPointCapability(gluePointId, ControlPointCapabilities.Glue))
				throw new NShapeException(string.Format("{0}'s point {1} has to be a glue point.", otherShape.Type.Name, gluePointId));
			throw new NotSupportedException();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:11,代码来源:ShapeGroup.cs

示例6: GetControlPointPosition

		/// <override></override>
		public override Point GetControlPointPosition(ControlPointId controlPointId)
		{
			if (controlPointId == ControlPointId.Reference)
				//return location;
				return children.Center;
			else if (controlPointId == RotatePointId)
				return RotatePoint;
			else if (controlPointId == ControlPointId.None)
				throw new ArgumentException(string.Format("{0} is not a valid {1} for this operation.", controlPointId,
				                                          typeof (ControlPointId).Name));
			return Point.Empty;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:13,代码来源:ShapeGroup.cs

示例7: FollowConnectionPointWithGluePoint

		/// <override></override>
		public override void FollowConnectionPointWithGluePoint(ControlPointId gluePointId, Shape connectedShape,
		                                                        ControlPointId movedPointId)
		{
			// nothing to do
		}
开发者ID:stewmc,项目名称:vixen,代码行数:6,代码来源:ShapeGroup.cs

示例8: GetConnectionInfo

		/// <override></override>
		public override ShapeConnectionInfo GetConnectionInfo(ControlPointId gluePointId, Shape otherShape)
		{
			return ShapeConnectionInfo.Empty;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:5,代码来源:ShapeGroup.cs

示例9: Disconnect

		/// <override></override>
		public override void Disconnect(ControlPointId gluePointId)
		{
			// nothing to do
		}
开发者ID:stewmc,项目名称:vixen,代码行数:5,代码来源:ShapeGroup.cs

示例10: HasControlPointCapability

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

示例11: GetControlPointPosition

        /// <override></override>
        public override Point GetControlPointPosition(ControlPointId controlPointId)
        {
            if (controlPointId == ControlPointId.Reference) {
                Point center = Point.Empty;
                center.X = X;
                center.Y = Y;
                return center;
            } else if (controlPointId == ControlPointId.None)
                throw new NShapeException("NotSupported PointId.");
            if (drawCacheIsInvalid) UpdateDrawCache();

            int index = GetControlPointIndex(controlPointId);
            return controlPoints[index];
        }
开发者ID:LudovicT,项目名称:NShape,代码行数:15,代码来源:PathBasedShape.cs

示例12: 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

示例13: FakeShapeConnection

        public void FakeShapeConnection(FilterSetupShapeBase shape, ControlPointId controlPoint, bool shapeIsSource)
        {
            DataFlowConnectionLine line = (DataFlowConnectionLine)project.ShapeTypes["DataFlowConnectionLine"].CreateInstance();
            diagramDisplay.InsertShape(line);
            diagramDisplay.Diagram.Shapes.SetZOrder(line, 100);
            line.SecurityDomainName = SECURITY_DOMAIN_FIXED_SHAPE_NO_CONNECTIONS_DELETABLE;

            line.EndCapStyle = new CapStyle("fakecapstyle", CapShape.Flat, project.Design.ColorStyles.Blue);
            //line.LineStyle = new LineStyle("fakelinestyle", 1, project.Design.ColorStyles.Gray);
            line.LineStyle = project.Design.LineStyles.Dashed;

            if (shapeIsSource) {
                line.SourceDataFlowComponentReference = new DataFlowComponentReference(shape.DataFlowComponent, shape.GetOutputNumberForControlPoint(controlPoint));
                line.Connect(ControlPointId.FirstVertex, shape, controlPoint);
                line.MoveControlPointTo(ControlPointId.LastVertex,
                    shape.GetControlPointPosition(controlPoint).X + 40,
                    shape.GetControlPointPosition(controlPoint).Y,
                    ResizeModifiers.None);
            } else {
                line.DestinationDataComponent = shape.DataFlowComponent;
                line.Connect(ControlPointId.LastVertex, shape, controlPoint);
                line.MoveControlPointTo(ControlPointId.FirstVertex,
                    shape.GetControlPointPosition(controlPoint).X - 40,
                    shape.GetControlPointPosition(controlPoint).Y,
                    ResizeModifiers.None);
            }
        }
开发者ID:naztrain,项目名称:vixen,代码行数:27,代码来源:SetupPatchingGraphical.cs

示例14: _RemoveDataFlowLinksFromShapePoint

        private void _RemoveDataFlowLinksFromShapePoint(FilterSetupShapeBase shape, ControlPointId controlPoint, bool removePatching)
        {
            foreach (ShapeConnectionInfo ci in shape.GetConnectionInfos(controlPoint, null)) {
                if (ci.OtherShape == null)
                    continue;

                DataFlowConnectionLine line = ci.OtherShape as DataFlowConnectionLine;
                if (line == null)
                    throw new Exception("a shape was connected to something other than a DataFlowLine!");

                // only try and unpatch if we're supposed to; this function can also be used to hide/remove lines from the display
                if (removePatching) {
                    // if the line is connected with the given shape as the SOURCE, remove the unknown DESTINATION's
                    // source (on the other end of the line). Otherwise, it (should) be that the given shape is the
                    // destination; so reset it's source. If neither of these are true, freak out.
                    if (line.GetConnectionInfo(ControlPointId.FirstVertex, null).OtherShape == shape) {
                        if (line.DestinationDataComponent != null)
                            VixenSystem.DataFlow.ResetComponentSource(line.DestinationDataComponent);
                    }
                    else if (line.GetConnectionInfo(ControlPointId.LastVertex, null).OtherShape == shape) {
                        VixenSystem.DataFlow.ResetComponentSource(shape.DataFlowComponent);
                    }
                    else {
                        throw new Exception("Can't reset a link that has neither the source or destination for the given shape!");
                    }

                    OnPatchingUpdated();
                }

                _RemoveShapeFromDiagram(line, false);
            }
        }
开发者ID:naztrain,项目名称:vixen,代码行数:32,代码来源:SetupPatchingGraphical.cs

示例15: TemplateControllerPointMappingChangedEventArgs

		/// <ToBeCompleted></ToBeCompleted>
		public TemplateControllerPointMappingChangedEventArgs(Template template, ControlPointId controlPointId,
		                                                      TerminalId oldTerminalId, TerminalId newTerminalId)
			: base(template)
		{
			this.controlPointId = controlPointId;
			this.oldTerminalId = oldTerminalId;
			this.newTerminalId = newTerminalId;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:9,代码来源:TemplateController.cs


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