예제 #1
0
        protected virtual void RaiseOnEntityRemoved(EntityEventArgs e)
        {
            EventHandler <EntityEventArgs> handler = OnEntityRemoved;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #2
0
 void mDefaultPage_OnEntityAdded(object sender, EntityEventArgs e)
 {
     //don't add it if it's already there or if it's a group (unless you want to deploy something special to emphasize a group shape).
     if (!mPaintables.Contains(e.Entity) && !(e.Entity is IGroup))
     {
         //set the new entity on top of the stack
         e.Entity.SceneIndex = mPaintables.Count;
         mPaintables.Add(e.Entity);
     }
     RaiseOnEntityAdded(e);
 }
예제 #3
0
 void mDefaultPage_OnEntityRemoved(object sender, EntityEventArgs e)
 {
     if (mPaintables.Contains(e.Entity))
     {
         //shift the entities above the one to be removed
         int index = e.Entity.SceneIndex;
         foreach (IDiagramEntity entity in mPaintables)
         {
             if (entity.SceneIndex > index)
             {
                 entity.SceneIndex--;
             }
         }
         mPaintables.Remove(e.Entity);
     }
     //if the selection contains the shape we have to remove it from the selection
     if (Selection.SelectedItems.Contains(e.Entity))
     {
         Selection.SelectedItems.Remove(e.Entity);
     }
     RaiseOnEntityRemoved(e);
 }
예제 #4
0
 void mModel_OnEntityAdded(object sender, EntityEventArgs e)
 {
     RaiseOnEntityAdded(e);
 }