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


C# Shape.IsConnected方法代码示例

本文整理汇总了C#中Shape.IsConnected方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.IsConnected方法的具体用法?C# Shape.IsConnected怎么用?C# Shape.IsConnected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shape的用法示例。


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

示例1: ExcludeFromFitting

 // There are lines without glue points (SwitchBar) and planar shapes with glue points (Label)
 // so we better check on glue points here...
 /// <ToBeCompleted></ToBeCompleted>
 protected bool ExcludeFromFitting(Shape shape)
 {
     foreach (ControlPointId pointId in shape.GetControlPointIds(ControlPointCapabilities.Glue)) {
         if (shape.IsConnected(pointId, null) != ControlPointId.None) return true;
     }
     return false;
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:10,代码来源:Layouter.cs

示例2: DeletePreviewShape

		/// <summary>
		/// Disconnect, disposes and deletes the given preview <see cref="T:Dataweb.NShape.Advanced.Shape" />.
		/// </summary>
		/// <param name="shape"></param>
		protected void DeletePreviewShape(ref Shape shape) {
			if (shape != null) {
				// Disconnect all existing connections (disconnects model, too)
				foreach (ControlPointId pointId in shape.GetControlPointIds(ControlPointCapabilities.Connect | ControlPointCapabilities.Glue)) {
					ControlPointId otherPointId = shape.IsConnected(pointId, null);
					if (otherPointId != ControlPointId.None) shape.Disconnect(pointId);
				}
				// Delete model obejct
				if (shape.ModelObject != null)
					shape.ModelObject = null;
				// Delete shape
				shape.Invalidate();
				shape.Dispose();
				shape = null;
			}
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:20,代码来源:Tool.cs

示例3: GetGluePointState

 private GluePointState GetGluePointState(Shape shape)
 {
     int gluePtCnt = 0, connectedGluePtCnt = 0;
     foreach (ControlPointId gluePtId in shape.GetControlPointIds(ControlPointCapabilities.Glue)) {
         ++gluePtCnt;
         if (shape.IsConnected(gluePtId, null) != ControlPointId.None)
             ++gluePtCnt;
     }
     // Skip shapes connected with all glue points as they will move with their partner shape
     if (gluePtCnt == 0)
         return GluePointState.HasNone;
     else {
         if (connectedGluePtCnt == 0)
             return GluePointState.NoneConnected;
         if (connectedGluePtCnt == gluePtCnt)
             return GluePointState.AllConnected;
         else return GluePointState.SomeConnected;
     }
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:19,代码来源:ShapeAggregation.cs

示例4: IsExtendLineFeasible

		private bool IsExtendLineFeasible(Action action, Shape shape, ControlPointId pointId) {
			if (action != Action.None && action != Action.ExtendLine) return false;
			if ((shape as ILinearShape) == null) return false;
			if (pointId == ControlPointId.None) return false;
			if (shape.Type != Template.Shape.Type) return false;
			if (((ILinearShape)shape).VertexCount >= ((ILinearShape)shape).MaxVertexCount) return false;
			if (!shape.HasControlPointCapability(pointId, ControlPointCapabilities.Glue)) return false;
			if (shape.IsConnected(pointId, null) != ControlPointId.None) return false;
			return true;
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:10,代码来源:Tool.cs


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