コード例 #1
0
ファイル: ClassModelData.cs プロジェクト: WrongDog/Sequence
    /// <summary>
    /// Adds the connector.
    /// </summary>
    /// <param name="connectorInfo">The connector info.</param>
    public void AddConnector(ClassConnectorInfo connectorInfo)
    {
      if (connectorInfo == null)
      {
        throw new ArgumentNullException("connectorInfo");
      }

      this.connectorList.Add(connectorInfo);
    }
コード例 #2
0
ファイル: ModelContext.cs プロジェクト: WrongDog/Sequence
    public void AddModelRelation(ClassConnectorInfo associationData)
    {
      if (associationData == null)
      {
        throw new ArgumentNullException("associationData");
      }
      else if (associationData.Parent == null || associationData.Child == null)
      {
        throw new ArgumentException(Properties.Resources.ParentOrChildDataNotFound, "associationData");
      }

      ExtendedObjectInfo parent = DiagramContext.DiagramObjects.Find(associationData.Parent.Key) as ExtendedObjectInfo;
      ExtendedObjectInfo child = DiagramContext.DiagramObjects.Find(associationData.Child.Key) as ExtendedObjectInfo;

      if (parent == null || child == null)
      {
        throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ParentOrChildObjectInfoNotFound, parent == null ? associationData.Parent.Key : associationData.Child.Key), "associationData");
      }

      ObjectRelationInfo relation = new ObjectRelationInfo(parent, child, associationData.Name);
      DiagramContext.Relations.Add(relation);
    }