Exemple #1
0
        /// <ToBeCompleted></ToBeCompleted>
        public RepositoryShapeConnectionEventArgs(Shape connectorShape, ControlPointId gluePointId, Shape targetShape, ControlPointId targetPointId)
            : this()
        {
            if (connectorShape == null)
            {
                throw new ArgumentNullException("connectorShape");
            }
            if (targetShape == null)
            {
                throw new ArgumentNullException("targetShape");
            }
            if (gluePointId == ControlPointId.Any || gluePointId == ControlPointId.None)
            {
                throw new ArgumentException("gluePointId");
            }
            if (!connectorShape.HasControlPointCapability(gluePointId, ControlPointCapabilities.Glue))
            {
                throw new ArgumentException(string.Format(Dataweb.NShape.Properties.Resources.MessageFmt_0IsNotAGluePointOf1, gluePointId, connectorShape.Type.FullName));
            }
            if (targetPointId == ControlPointId.Any || targetPointId == ControlPointId.None)
            {
                throw new ArgumentException("targetPointId");
            }
            if (!targetShape.HasControlPointCapability(targetPointId, ControlPointCapabilities.Connect))
            {
                throw new ArgumentException(string.Format(Dataweb.NShape.Properties.Resources.MessageFmt_0IsNotAConnectionPointOf1, targetPointId, targetShape.Type.FullName));
            }

            this._connection.ConnectorShape = connectorShape;
            this._connection.GluePointId    = gluePointId;
            this._connection.TargetShape    = targetShape;
            this._connection.TargetPointId  = targetPointId;
        }
Exemple #2
0
        /// <ToBeCompleted></ToBeCompleted>
        public RepositoryShapeConnectionEventArgs(Shape connectorShape, ControlPointId gluePointId, Shape targetShape, ControlPointId targetPointId)
            : this()
        {
            if (connectorShape == null)
            {
                throw new ArgumentNullException("connectorShape");
            }
            if (targetShape == null)
            {
                throw new ArgumentNullException("targetShape");
            }
            if (gluePointId == ControlPointId.Any || gluePointId == ControlPointId.None)
            {
                throw new ArgumentException("gluePointId");
            }
            if (!connectorShape.HasControlPointCapability(gluePointId, ControlPointCapabilities.Glue))
            {
                throw new ArgumentException(string.Format("{0} is not a glue point of {1}.", gluePointId, connectorShape.Type.FullName));
            }
            if (targetPointId == ControlPointId.Any || targetPointId == ControlPointId.None)
            {
                throw new ArgumentException("targetPointId");
            }
            if (!targetShape.HasControlPointCapability(targetPointId, ControlPointCapabilities.Connect))
            {
                throw new ArgumentException(string.Format("{0} is not a connection point of {1}.", targetPointId, targetShape.Type.FullName));
            }

            this.connection.ConnectorShape = connectorShape;
            this.connection.GluePointId    = gluePointId;
            this.connection.TargetShape    = targetShape;
            this.connection.TargetPointId  = targetPointId;
        }