コード例 #1
0
ファイル: Model.cs プロジェクト: thunder176/HeuristicLab
 // ------------------------------------------------------------------
 /// <summary>
 /// Unwraps an entity
 /// <list type="bullet">
 /// <term>Uid</term><description>Generates a new <see cref="IDiagramEntity.Uid"/> for the entity. </description>
 /// <tem>Model</tem><description>Assigns the Model property to the entity.</description>
 ///
 /// </list>
 /// </summary>
 // ------------------------------------------------------------------
 public void Unwrap(IDiagramEntity entity)
 {
     //set a new unique identifier for this copied object
     entity.NewUid(true);
     //this assignment will be recursive if needed
     SetModel(entity);
     CurrentPage.DefaultLayer.Entities.Add(entity);
     entity.Attached(CurrentPage.DefaultLayer);
 }
コード例 #2
0
ファイル: Model.cs プロジェクト: thunder176/HeuristicLab
 // ------------------------------------------------------------------
 /// <summary>
 /// Adds an entity to the diagram.  The magnification level for the
 /// entity is set to the current magnification level of the current
 /// page.
 /// </summary>
 /// <param name="entity">IDiagramEntity: The entity to add.</param>
 /// <returns>IDiagramEntity: The added entity.</returns>
 // ------------------------------------------------------------------
 public IDiagramEntity AddEntity(IDiagramEntity entity)
 {
     SetModel(entity);
     //By default the new entity is added to the default layer in the
     // current page.
     CurrentPage.DefaultLayer.Entities.Add(entity);
     entity.Attached(CurrentPage.DefaultLayer);
     entity.Magnification = CurrentPage.Magnification;
     return(entity);
 }
コード例 #3
0
ファイル: Model.cs プロジェクト: thunder176/HeuristicLab
 // ------------------------------------------------------------------
 /// <summary>
 /// Adds an entity to the diagram.  The magnification level for the
 /// entity is set to the current magnification level of the current 
 /// page.
 /// </summary>
 /// <param name="entity">IDiagramEntity: The entity to add.</param>
 /// <returns>IDiagramEntity: The added entity.</returns>
 // ------------------------------------------------------------------
 public IDiagramEntity AddEntity(IDiagramEntity entity) {
   SetModel(entity);
   //By default the new entity is added to the default layer in the 
   // current page.
   CurrentPage.DefaultLayer.Entities.Add(entity);
   entity.Attached(CurrentPage.DefaultLayer);
   entity.Magnification = CurrentPage.Magnification;
   return entity;
 }
コード例 #4
0
ファイル: Model.cs プロジェクト: thunder176/HeuristicLab
    // ------------------------------------------------------------------
    /// <summary>
    /// Unwraps an entity
    /// <list type="bullet">
    /// <term>Uid</term><description>Generates a new <see cref="IDiagramEntity.Uid"/> for the entity. </description>
    /// <tem>Model</tem><description>Assigns the Model property to the entity.</description>
    /// 
    /// </list>
    /// </summary>
    // ------------------------------------------------------------------
    public void Unwrap(IDiagramEntity entity) {
      //set a new unique identifier for this copied object
      entity.NewUid(true);
      //this assignment will be recursive if needed
      SetModel(entity);
      CurrentPage.DefaultLayer.Entities.Add(entity);
      entity.Attached(CurrentPage.DefaultLayer);

    }