AcceptChanges() public static method

public static AcceptChanges ( MonoDevelop.Core.ProgressMonitor monitor, IList changes ) : void
monitor MonoDevelop.Core.ProgressMonitor
changes IList
return void
コード例 #1
0
        public virtual void Run(RefactoringOptions options)
        {
            List <Change>    changes = PerformChanges(options, null);
            IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor(Name, null);

            RefactoringService.AcceptChanges(monitor, options.Dom, changes);
        }
コード例 #2
0
        public RefactoringPreviewDialog(ProjectDom ctx, List <Change> changes)
        {
            this.Build();
            this.changes          = changes;
            treeviewPreview.Model = store;

            TreeViewColumn column = new TreeViewColumn();

            // pixbuf column
            var pixbufCellRenderer = new CellRendererPixbuf();

            column.PackStart(pixbufCellRenderer, false);
            column.SetAttributes(pixbufCellRenderer, "pixbuf", pixbufColumn);
            column.AddAttribute(pixbufCellRenderer, "visible", statusVisibleColumn);

            // text column
            CellRendererText cellRendererText = new CellRendererText();

            column.PackStart(cellRendererText, false);
            column.SetAttributes(cellRendererText, "text", textColumn);
            column.AddAttribute(cellRendererText, "visible", statusVisibleColumn);

            // location column
            CellRendererText cellRendererText2 = new CellRendererText();

            column.PackStart(cellRendererText2, false);
            column.SetCellDataFunc(cellRendererText2, new TreeCellDataFunc(SetLocationTextData));

            CellRendererDiff cellRendererDiff = new CellRendererDiff();

            column.PackStart(cellRendererDiff, true);
            column.SetCellDataFunc(cellRendererDiff, new TreeCellDataFunc(SetDiffCellData));

            treeviewPreview.AppendColumn(column);
            treeviewPreview.HeadersVisible = false;

            buttonCancel.Clicked += delegate {
                Destroy();
            };

            buttonOk.Clicked += delegate {
                IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor(this.Title, null);
                RefactoringService.AcceptChanges(monitor, ctx, changes);

                Destroy();
            };

            FillChanges();
            Resize(IdeApp.Workbench.ActiveDocument.ActiveView.Control.Allocation.Width,
                   IdeApp.Workbench.ActiveDocument.ActiveView.Control.Allocation.Height);
        }
コード例 #3
0
        public RefactoringPreviewDialog(IList <Change> changes)
        {
            this.Build();
            this.changes                 = changes;
            treeviewPreview.Model        = store;
            treeviewPreview.SearchColumn = -1;             // disable the interactive search

            TreeViewColumn column = new TreeViewColumn();

            // pixbuf column
            var pixbufCellRenderer = new CellRendererImage();

            column.PackStart(pixbufCellRenderer, false);
            column.SetAttributes(pixbufCellRenderer, "image", pixbufColumn);
            column.AddAttribute(pixbufCellRenderer, "visible", statusVisibleColumn);

            // text column
            CellRendererText cellRendererText = new CellRendererText();

            column.PackStart(cellRendererText, false);
            column.SetAttributes(cellRendererText, "text", textColumn);
            column.AddAttribute(cellRendererText, "visible", statusVisibleColumn);

            // location column
            CellRendererText cellRendererText2 = new CellRendererText();

            column.PackStart(cellRendererText2, false);
            column.SetCellDataFunc(cellRendererText2, new TreeCellDataFunc(SetLocationTextData));

            CellRendererDiff cellRendererDiff = new CellRendererDiff();

            column.PackStart(cellRendererDiff, true);
            column.SetCellDataFunc(cellRendererDiff, new TreeCellDataFunc(SetDiffCellData));

            treeviewPreview.AppendColumn(column);
            treeviewPreview.HeadersVisible = false;

            buttonCancel.Clicked += delegate {
                Destroy();
            };

            buttonOk.Clicked += delegate {
                ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor(this.Title, null);
                RefactoringService.AcceptChanges(monitor, changes);

                Destroy();
            };

            FillChanges();
        }