Beispiel #1
0
        private void RenamePopup_Opened(object sender, EventArgs e)
        {
            SetTextboxContentAndSize();
            _targetItem = ViewModel.Workspace.ActiveLister.View.ListView.SelectedItem as IItem;
            if (_targetItem is IRenameable renameable)
            {
                _cancelRename = false;
                _renameable   = renameable;
                var selectionBorders = _renameable.GetRenameSelectonBorder();
                RenameTextBox.SelectionStart  = selectionBorders.Item1;
                RenameTextBox.SelectionLength = selectionBorders.Item2;
            }
            else
            {
                return;
            }

            RenameTextBox.Focus();
        }
Beispiel #2
0
 public RenameMenuEntry(ICommandHistory commandHistory, IRenameable renameable, ILabelEditor labelEditor)
     : base(commandHistory, "Rename", Keys.F2)
 {
     Renameable  = renameable;
     LabelEditor = labelEditor;
 }
Beispiel #3
0
 public RenameMenuEntry(ICommandHistory commandHistory, IRenameable renameable)
     : this(commandHistory, renameable, null)
 {
 }
Beispiel #4
0
 public RenameCommand(IRenameable renameable, string newName)
 {
     FRenameable = renameable;
     FNewName    = newName;
     FOldName    = FRenameable.Name;
 }
Beispiel #5
0
        private void DoRename()
        {
            IRenameable action = tvProjects.SelectedNode.Tag as IRenameable;

            action.Rename();
        }
Beispiel #6
0
        private void tvProjects_AfterSelect(object sender, TreeViewEventArgs e)
        {
            INodeHandler handler = e.Node.Tag as INodeHandler;

            if (handler != null)
            {
                if (handler.IsFirstClick)
                {
                    handler.OnFirstClick();
                }
                else
                {
                    handler.OnClick();
                }
            }
            splitContainer1.Panel2.Controls.Clear();

            IDeleteable del = handler as IDeleteable;

            tsbtnDelete.Enabled = false;
            if (del != null)
            {
                tsbtnDelete.Enabled     = true;
                tsbtnDelete.ToolTipText = del.TitleOfDelete;
                menuProject.Items.Add(del.TitleOfDelete, actImgs.Images["delete"], cmDelete_Click);
            }

            IAddable add = handler as IAddable;

            tsbtnAdd.Enabled = false;
            if (add != null)
            {
                tsbtnAdd.Enabled     = true;
                tsbtnAdd.ToolTipText = add.TitleOfAdd;
                menuProject.Items.Add(add.TitleOfAdd, actImgs.Images["add"], cmAdd_Click);
            }

            IReloadable reload = handler as IReloadable;

            tsbtnReload.Enabled = false;
            if (reload != null)
            {
                tsbtnReload.Enabled = true;
            }

            ITestable test = handler as ITestable;

            tsbtnTest.Enabled = false;
            if (test != null)
            {
                tsbtnTest.Image   = actImgs.Images[test.TestImageKey];
                tsbtnTest.Enabled = true;
            }

            IRenameable rename = handler as IRenameable;

            tsbtnRename.Enabled = false;
            if (rename != null)
            {
                tsbtnRename.Enabled = true;
            }

            IExportable export = handler as IExportable;

            tsbtnExport.Enabled = false;
            if (export != null)
            {
                tsbtnExport.Enabled = true;
            }

            ISetupable setup = handler as ISetupable;

            cmSetup.Enabled = false;
            if (setup != null)
            {
                cmSetup.Enabled = true;
            }

            IDeployable deploy = handler as IDeployable;

            cmDeploy.Enabled = false;
            if (deploy != null)
            {
                cmDeploy.Enabled = true;
            }

            IDeployToPhysical phyDeploy = handler as IDeployToPhysical;

            tsbtnDeployToPhysical.Enabled = false;
            if (phyDeploy != null)
            {
                tsbtnDeployToPhysical.Enabled = true;
            }

            IImportFromPhysical phyImport = handler as IImportFromPhysical;

            tsbtnImportFromPhysical.Enabled = false;
            if (phyImport != null)
            {
                tsbtnImportFromPhysical.Enabled = true;
            }

            IImportable import = handler as IImportable;

            tsbtnImport.Enabled = false;
            if (import != null)
            {
                tsbtnImport.Enabled = true;
            }

            IJoinProject joinProject = handler as IJoinProject;

            tsbtnJoinProject.Enabled = false;
            if (joinProject != null)
            {
                tsbtnJoinProject.Enabled = true;
            }

            ILeaveProject leaveProject = handler as ILeaveProject;

            tsbtnLeaveProject.Enabled = false;
            if (leaveProject != null)
            {
                tsbtnLeaveProject.Enabled = true;
            }

            ISyncUpload syncUplaod = handler as ISyncUpload;

            cmUpload.Enabled = false;
            if (syncUplaod != null)
            {
                cmUpload.Enabled = true;
            }

            ISyncUpload syncDownload = handler as ISyncUpload;

            cmDownload.Enabled = false;
            if (syncDownload != null)
            {
                cmDownload.Enabled = true;
            }

            tsEditMode.Items.Clear();
            rsbtnSave.Enabled = false;
            IEditorManager manager = handler as IEditorManager;

            if (manager != null)
            {
                rsbtnSave.Enabled = false;
                foreach (IEditable editable in manager.Editors)
                {
                    ToolStripItem item = tsEditMode.Items.Add(editable.ModeTitle, actImgs.Images[editable.ImageKey], cmEdit_Click);
                    item.ToolTipText = editable.ModeTitle;
                    item.Text        = string.Empty;
                    item.Tag         = editable;
                }
            }
        }
Beispiel #7
0
 public static Command Rename(IRenameable renameable, string name)
 {
     return(new RenameCommand(renameable, name));
 }