Esempio n. 1
0
 private void _state_StateChanged(object sender, ParserStateEventArgs e)
 {
     if (e.State == ParserState.Pending)
     {
         UiDispatcher.InvokeAsync(Refresh);
     }
 }
        private void FileSystemCreated(object sender, FileSystemEventArgs e)
        {
            if (!HandleExternalModifications(e.Name))
            {
                return;
            }

            Logger.Trace("FileSystemWatcher detected the creation of a file.");
            Provider.AddFile(e.FullPath);
            UiDispatcher.InvokeAsync(Refresh);
        }
        private void FileSystemDeleted(object sender, FileSystemEventArgs e)
        {
            if (!HandleExternalModifications(e.Name))
            {
                return;
            }

            Logger.Trace("Handling FileSystemWatcher delete activity notification.");
            Provider.RemoveFile(e.FullPath, true);
            UiDispatcher.InvokeAsync(Refresh);
        }
        private void FileSystemChanged(object sender, FileSystemEventArgs e)
        {
            if (!HandleExternalModifications(e.Name))
            {
                Logger.Trace("Ignoring FileSystemWatcher activity notification.");
                return;
            }

            Provider.ReloadComponent(e.Name);
            UiDispatcher.InvokeAsync(Refresh);
        }
        private void _state_StateChanged(object sender, ParserStateEventArgs e)
        {
            if (_viewModel == null)
            {
                return;
            }

            if (_state.Status != ParserState.Error && _state.Status != ParserState.Parsed)
            {
                return;
            }

            UiDispatcher.InvokeAsync(UpdateTab);
        }
        private void ResetView()
        {
            Logger.Trace("Resetting view");

            _provider = null;
            OnPropertyChanged("RepoDoesNotHaveRemoteLocation");
            Status = RubberduckUI.Offline;

            UiDispatcher.InvokeAsync(() =>
            {
                foreach (var tab in _tabItems)
                {
                    tab.ViewModel.ResetView();
                }
            });
        }
Esempio n. 7
0
        private void _fileSystemWatcher_Created(object sender, FileSystemEventArgs e)
        {
            // the file system filter doesn't support multiple filters
            if (!VbFileExtensions.Contains(e.Name.Split('.').Last()))
            {
                return;
            }

            if (!Provider.NotifyExternalFileChanges)
            {
                return;
            }

            Logger.Trace("File system watcher detected file created");
            if (_messageBox.Show(RubberduckUI.SourceControl_ExternalModifications, RubberduckUI.SourceControlPanel_Caption,
                                 MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.OK)
            {
                Provider.AddFile(e.FullPath);
                UiDispatcher.InvokeAsync(Refresh);
            }
        }
        private void ResetView()
        {
            Logger.Trace("Resetting view");

            _provider = null;
            OnPropertyChanged("RepoDoesNotHaveRemoteLocation");
            Status = RubberduckUI.Offline;

            UiDispatcher.InvokeAsync(() =>
            {
                try
                {
                    foreach (var tab in _tabItems)
                    {
                        tab.ViewModel.ResetView();
                    }
                }
                catch (Exception exception)
                {
                    Logger.Error(exception, "Exception thrown while trying to reset the source control view on the UI thread.");
                }
            });
        }