示例#1
0
        void OnUpdateOpen(object sender, CommandUpdateEventArgs e)
        {
            RepositoryExplorerItem item = EnumTools.GetSingle(e.Selection.GetSelection <RepositoryExplorerItem>());

            if (item == null || item.Uri == null)
            {
                e.Enabled = false;
            }
        }
示例#2
0
        internal void OnAfterEdit(RepositoryExplorerItem item, string newName, CancelEventArgs e)
        {
            if (!AllowRenames || SvnRevision != SvnRevision.Head || string.IsNullOrEmpty(newName))
            {
                e.Cancel = true;
                return;
            }

            CommandResult cr = Context.GetService <IAnkhCommandService>().DirectlyExecCommand(AnkhCommand.RenameRepositoryItem, new string[] { newName });
        }
示例#3
0
 internal void OnItemEdit(RepositoryExplorerItem item, CancelEventArgs e)
 {
     if (!AllowRenames || SvnRevision != SvnRevision.Head || item.Origin == null ||
         item.Origin.IsRepositoryRoot)
     {
         e.Cancel = true;
         return;
     }
     //e.Cancel = true;
 }
示例#4
0
        void OnOpen(object sender, CommandEventArgs e)
        {
            RepositoryExplorerItem item = EnumTools.GetSingle(e.Selection.GetSelection <RepositoryExplorerItem>());

            if (item.Entry == null || item.Entry.NodeKind == SvnNodeKind.Directory || item.Origin == null)
            {
                treeView.BrowseTo(item.Uri);
                return;
            }

            AutoOpenCommand(e, item.Origin);
        }
示例#5
0
        protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            try
            {
                RepositoryTreeNode item = e.Node as RepositoryTreeNode;
                if (_editItem != null && _editItem.TreeNode == item)
                {
                    CancelEventArgs c = new CancelEventArgs();
                    OnAfterEdit(_editItem, e.Label, c);

                    e.CancelEdit = true;
                }
            }
            finally
            {
                _editItem = null;
            }
        }
示例#6
0
        protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
        {
            base.OnBeforeLabelEdit(e);

            _editItem = null;
            RepositoryTreeNode item = e.Node as RepositoryTreeNode;

            if (item == null || !AllowRenames || SvnRevision != SvnRevision.Head)
            {
                e.CancelEdit = true;
            }
            else
            {
                CancelEventArgs ce = new CancelEventArgs(e.CancelEdit);
                OnItemEdit(_editItem = new RepositoryExplorerItem(Context, item.Origin, item), ce);

                if (ce.Cancel)
                {
                    e.CancelEdit = true;
                }
            }
        }
示例#7
0
        protected override void OnBeforeLabelEdit(LabelEditEventArgs e)
        {
            base.OnBeforeLabelEdit(e);

            _editItem = null;
            RepositoryListItem item = Items[e.Item] as RepositoryListItem;

            if (RepositoryTreeView == null || item == null)
            {
                e.CancelEdit = true;
            }
            else
            {
                CancelEventArgs ce = new CancelEventArgs(e.CancelEdit);
                RepositoryTreeView.OnItemEdit(_editItem = new RepositoryExplorerItem(Context, item.Origin, item), ce);

                if (ce.Cancel)
                {
                    e.CancelEdit = true;
                }
            }
        }
示例#8
0
        protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            try
            {
                RepositoryListItem item = Items[e.Item] as RepositoryListItem;
                if (RepositoryTreeView != null && _editItem != null && _editItem.ListViewItem == item)
                {
                    CancelEventArgs c = new CancelEventArgs();
                    RepositoryTreeView.OnAfterEdit(_editItem, e.Label, c);

                    if (c.Cancel)
                    {
                        e.CancelEdit = true;
                    }
                }
            }
            finally
            {
                _editItem = null;
            }
        }