Example #1
0
        public int ApplyChanges()
        {
            _input.ClearRefactorPane();
            _input.OutputLog(Strings.RefactorPreviewChangesRenaming.FormatUI(OriginalName, Request.Name));

            var undo = _input.BeginGlobalUndo();

            try {
                foreach (FilePreviewItem changedFile in _list.Items)
                {
                    var buffer = _input.GetBufferForDocument(changedFile.Filename);

                    changedFile.UpdateBuffer(buffer);
                }
            } finally {
                _input.EndGlobalUndo(undo);
            }

            return(VSConstants.S_OK);
        }
Example #2
0
        public int ApplyChanges()
        {
            _input.ClearRefactorPane();
            _input.OutputLog(String.Format("Renaming '{0}' to '{1}'", _originalName, _renameReq.Name));

            var undo = _input.BeginGlobalUndo();

            try
            {
                foreach (var previewItem in _list.Items)
                {
                    var changedFile = (FilePreviewItem)previewItem;
                    var buffer      = _input.GetBufferForDocument(changedFile.Filename);

                    changedFile.UpdateBuffer(buffer);
                }
            }
            finally
            {
                _input.EndGlobalUndo(undo);
            }

            return(VSConstants.S_OK);
        }