本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例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;
}