/// <summary> /// Handles drop event /// </summary> /// <param name="sourceNode"></param> public override void AcceptDrop(BaseTreeNode sourceNode) { if (sourceNode is ShortcutTreeNode) { ShortcutTreeNode shortcut = sourceNode as ShortcutTreeNode; if (shortcut.Item.Dictionary == Item.Dictionary) { Shortcut otherShortcut = (Shortcut)shortcut.Item.Duplicate(); Item.appendShortcuts(otherShortcut); shortcut.Delete(); } } else if (sourceNode is ShortcutFolderTreeNode) { ShortcutFolderTreeNode folder = sourceNode as ShortcutFolderTreeNode; if (folder.Item.Dictionary == Item.Dictionary) { ShortcutFolder otherFolder = (ShortcutFolder)folder.Item.Duplicate(); Item.appendFolders(otherFolder); folder.Delete(); } } else { Namable namable = sourceNode.Model as Namable; Shortcut shortcut = (Shortcut)acceptor.getFactory().createShortcut(); shortcut.CopyFrom(namable); Item.appendShortcuts(shortcut); } }
public override void DoubleClickHandler() { base.DoubleClickHandler(); DataDictionary.Namable element = Item.GetReference(); if (element != null) { MainWindow mainWindow = BaseForm.MDIWindow; if (mainWindow.DataDictionaryWindow != null) { if (mainWindow.DataDictionaryWindow.TreeView.Select(element) != null) { mainWindow.DataDictionaryWindow.Focus(); } } if (mainWindow.SpecificationWindow != null) { if (mainWindow.SpecificationWindow.TreeView.Select(element) != null) { mainWindow.SpecificationWindow.Focus(); } } if (mainWindow.TestWindow != null) { if (mainWindow.TestWindow.TreeView.Select(element) != null) { mainWindow.TestWindow.Focus(); } } } }
public override void visit(DataDictionary.Generated.Namable obj, bool visitSubNodes) { DataDictionary.Namable namable = (DataDictionary.Namable)obj; if (namable.FullName != null && namable.FullName.Contains(SearchString)) { namable.AddInfo(SearchString + " found here"); } base.visit(obj, visitSubNodes); }
/// <summary> /// Creates a new shortcut based on a namable element /// </summary> /// <param name="step"></param> private void createShortcut(DataDictionary.Namable namable) { DataDictionary.Shortcuts.Shortcut shortcut = (DataDictionary.Shortcuts.Shortcut)DataDictionary.Generated.acceptor.getFactory().createShortcut(); createShortcut(shortcut); }