public override void Redo()
        {
            if (Grid.EditorControl.Editor.ReadOnly)
            {
                throw new Exception("Cannot perform this operation - the document is readonly.");
            }

            try {
                Grid.SuspendLayout();
                foreach (var element in Elements.Where((el) => { return(el != null); }).OrderByDescending((el) => { return(el.IndexAtDeleteTime); }))
                {
                    ResXStringGridRow row = Grid.Rows[element.IndexAtDeleteTime] as ResXStringGridRow;

                    // unregister from the conflict resolver
                    ConflictResolver.TryAdd(row.Key, null, row, Control.Editor.ProjectItem, null);
                    row.Cells[Grid.KeyColumnName].Tag = null;

                    // remvoe the row
                    Grid.Rows.RemoveAt(element.IndexAtDeleteTime);
                }
                Grid.ResumeLayout();
                Grid.NotifyDataChanged();

                VLOutputWindow.VisualLocalizerPane.WriteLine("Re-deleted {0} string rows", Elements.Count);
                Grid.SetContainingTabPageSelected();
            } catch (Exception ex) {
                VLOutputWindow.VisualLocalizerPane.WriteException(ex);
                VisualLocalizer.Library.Components.MessageBox.ShowException(ex);
            }
        }
        public GridRenameKeyUndoUnit(ResXStringGridRow sourceRow, ResXEditorControl control, string oldKey, string newKey)
            : base(oldKey, newKey)
        {
            if (sourceRow == null)
            {
                throw new ArgumentNullException("sourceRow");
            }
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            this.SourceRow = sourceRow;
            this.Control   = control;
        }
Esempio n. 3
0
        public GridChangeCommentUndoUnit(ResXStringGridRow sourceRow, AbstractResXEditorGrid grid, string key, string oldComment, string newComment)
        {
            if (sourceRow == null)
            {
                throw new ArgumentNullException("sourceRow");
            }
            if (grid == null)
            {
                throw new ArgumentNullException("grid");
            }

            this.SourceRow  = sourceRow;
            this.Grid       = grid;
            this.Key        = key;
            this.OldComment = oldComment;
            this.NewComment = newComment;
        }