コード例 #1
0
        public void MenuUndoGit_Click(object sende, RoutedEventArgs e)
        {
            var selectedFiles = FolderBrowser.GetSelectedItems();

            if (selectedFiles.Count < 1)
            {
                return;
            }

            var gh = new GitHelper();

            foreach (var selected in selectedFiles)
            {
                if (selected == null)
                {
                    continue;
                }

                if (selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInIndex &&
                    selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInWorkdir)
                {
                    continue;
                }

                gh.UndoChanges(selected.FullPath);
            }

            // force editors to update
            DocumentFileWatcher.CheckFileChangeInOpenDocuments();
        }
コード例 #2
0
        public void MenuUndoGit_Click(object sende, RoutedEventArgs e)
        {
            var selected = TreeFolderBrowser.SelectedItem as PathItem;

            if (selected == null)
            {
                return;
            }

            if (selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInIndex &&
                selected.FileStatus != LibGit2Sharp.FileStatus.ModifiedInWorkdir)
            {
                return;
            }

            var gh = new GitHelper();

            gh.UndoChanges(selected.FullPath);


            // force editors to update
            DocumentFileWatcher.CheckFileChangeInOpenDocuments();
        }
コード例 #3
0
 public DocumentWatcher(DocumentFileWatcher watcher, DocumentViewModel documentRoot)
 {
     _documentRoot = documentRoot;
     watcher.Path  = documentRoot.Path;
     _subscription = watcher.Subscribe(OnDocumentFileChanged);
 }
コード例 #4
0
 public MainViewModel(IServiceProvider serviceProvider, ITelemetryProvider telemetryProvider, ICommandProvider commands, IApplicationSettings settings, NuGetViewModel nugetViewModel, DocumentFileWatcher documentWatcher) : base(serviceProvider, telemetryProvider, commands, settings, nugetViewModel, documentWatcher)
 {
 }
コード例 #5
0
 public MainViewModel(IServiceProvider serviceProvider, IExceptionManager exceptionManager, ICommandProvider commands, IApplicationSettings settings, NuGetViewModel nugetViewModel, DocumentFileWatcher documentFileWatcher) :
     base(serviceProvider, exceptionManager, commands, settings, nugetViewModel, documentFileWatcher)
 {
 }