示例#1
0
        public MyControlViewModel()
        {
            // Subscribe to the options updated event
            Singleton.GetObject().OptionsUpdatedEvent += MyControlViewModel_OptionsUpdatedEvent;

            tfsController = new TFSItemController();

            // Sign up for solution events
            DTE dte = Common.GetApplicationReference();

            solutionEvents               = ((Events)dte.Events).SolutionEvents;
            solutionEvents.Opened       += solutionEvents_Opened;
            solutionEvents.AfterClosing += solutionEvents_AfterClosing;

            // Initially filter is empty
            searchText = "";

            // Setup the background worker for running the slower code
            FileLoadingWorker = new BackgroundWorker();
            FileLoadingWorker.WorkerSupportsCancellation = true;
            FileLoadingWorker.DoWork += FileLoadingWorker_DoWork;

            if (!tfsController.Connected)
            {
                return;
            }

            ReadFilesFromPath();
        }
示例#2
0
        private void ReconnectToTFSServer()
        {
            tfsController = new TFSItemController();

            // If connection was lost or a bad workstation was entered, clear all lists and exit
            if (!tfsController.Connected)
            {
                Files         = null;
                FilteredFiles = null;
                SearchedFiles = null;
                return;
            }

            ReadFilesFromPath();
        }