示例#1
0
        async void SelectSolution_Click(object sender, RoutedEventArgs e)
        {
            var filePath = SelectCsvFile(_tbSlnText.Text, "Выбор файла решения Visual Studio", "Visual Studio solutions (*.sln)|*.sln");

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            if (_solution != null)
            {
                _solution.Dispose();
                _solution = null;
            }

            _solutionFile = null;
            _analysisDone = false;
            _rewriteDone  = false;

            _tbSlnText.Text = filePath;
            var fileName = Path.GetFileName(filePath);

            await BlockInputAction(async() => {
                Log("Загрузка решения {0}...", filePath);

                _solution = new VSSolution(filePath);

                await _solution.LoadSolution();

                Log("Загружено решение {0}. {1} проектов, {2} файлов.", fileName, _solution.NumProjects, _solution.NumDocuments);

                var progress = new Progress <string>(msg => { Dispatcher.MyGuiAsync(() => { _busyIndicator.BusyContent = msg; }); });

                await _solution.CreateSemanticModel(progress);

                await _solution.CreateSymbolsTable(progress);

                // build and error check doesn't work for WPF projects
                // if(CheckSolutionErrors())
                //     return;

                if (_solution.NumProjects > 0 && _solution.NumDocuments > 0)
                {
                    _solutionFile = fileName;
                }
            }, "Загрузка " + fileName + "...");
        }
示例#2
0
		async void DoSolution(string filePath)
	    {
			if (_solution != null)
			{
				_solution.Dispose();
				_solution = null;
			}

			_solutionFile = null;
			_analysisDone = false;
			_rewriteDone = false;

			_tbSlnText.Text = filePath;
			var fileName = Path.GetFileName(filePath);

			await BlockInputAction(async () =>
			{
				Log("Загрузка решения {0}...", filePath);

				_solution = new VSSolution(filePath);

				await _solution.LoadSolution();

				Log("Загружено решение {0}. {1} проектов, {2} файлов.", fileName, _solution.NumProjects, _solution.NumDocuments);

				var progress = new Progress<string>(msg => { Dispatcher.MyGuiAsync(() => { _busyIndicator.BusyContent = msg; }); });

				await _solution.CreateSemanticModel(progress);

				await _solution.CreateSymbolsTable(progress);

				// build and error check doesn't work for WPF projects
				// if(CheckSolutionErrors())
				//     return;

				if (_solution.NumProjects > 0 && _solution.NumDocuments > 0)
					_solutionFile = fileName;

			}, "Загрузка " + fileName + "...");
	    }
示例#3
0
        async void SelectSolution_Click(object sender, RoutedEventArgs e) {
            var filePath = SelectCsvFile(_tbSlnText.Text, "Выбор файла решения Visual Studio", "Visual Studio solutions (*.sln)|*.sln");
            if(string.IsNullOrEmpty(filePath))
                return;

            if(_solution != null) {
                _solution.Dispose();
                _solution = null;
            }

            _solutionFile = null;
            _analysisDone = false;
            _rewriteDone = false;

            _tbSlnText.Text = filePath;
            var fileName = Path.GetFileName(filePath);

            await BlockInputAction(async () => {
                Log("Загрузка решения {0}...", filePath);

                _solution = new VSSolution(filePath);

                await _solution.LoadSolution();

                Log("Загружено решение {0}. {1} проектов, {2} файлов.", fileName, _solution.NumProjects, _solution.NumDocuments);

                var progress = new Progress<string>(msg => {Dispatcher.MyGuiAsync(() => { _busyIndicator.BusyContent = msg; });});

                await _solution.CreateSemanticModel(progress);

                await _solution.CreateSymbolsTable(progress);

                // build and error check doesn't work for WPF projects
                // if(CheckSolutionErrors())
                //     return;

                if(_solution.NumProjects > 0 && _solution.NumDocuments > 0)
                    _solutionFile = fileName;

            }, "Загрузка " + fileName + "...");
        }