public void AddObject(GuiItem item, string name_base) { item.parent = this; if (item is INeedRefresh) { RefreshObject((INeedRefresh)item); } item.id = RegisterItemID(name_base, item); item.Invalidate(); Undo.Push(new CreateOperation((IRemoveable)item), false); // add relations if (item is GuiClass) { GuiClass cl = (GuiClass)item; for (int i = 0; i < active_objects.Count; i++) { GuiObject obj = (GuiObject)active_objects[i]; if (obj is GuiClass) { foreach (UmlRelation rel in RelationsHelper.GetRelations(((GuiClass)obj).st, proj.model)) { if (rel.dest == cl.st || rel.src == cl.st) { NewRelation(rel); } } } } } }
public override void StopDrag() { if (dropitem == null) { throw new ArgumentException("have nothing to stop"); } dropitem.Invalidate(); dropitem = null; action = MouseAction.None; }
public void AddObject( GuiItem item, string name_base ) { item.parent = this; if( item is INeedRefresh ) RefreshObject( (INeedRefresh)item ); item.id = RegisterItemID( name_base, item ); item.Invalidate(); Undo.Push( new CreateOperation( (IRemoveable)item ), false ); // add relations if( item is GuiClass ) { GuiClass cl = (GuiClass)item; for( int i = 0; i < active_objects.Count; i++ ) { GuiObject obj = (GuiObject)active_objects[i]; if( obj is GuiClass ) foreach( UmlRelation rel in RelationsHelper.GetRelations( ((GuiClass)obj).st, proj.model ) ) if( rel.dest == cl.st || rel.src == cl.st ) NewRelation( rel ); } } }