Пример #1
0
        public bool SaveSolutionSettings(SolutionSettings settings)
        {
            string solutionFolder = visualStudioAdapter.GetSolutionFolder();

            if (String.IsNullOrEmpty(solutionFolder))
            {
                throw new InvalidOperationException("Solution folder in not specified");
            }

            string settingsFolder = Path.Combine(solutionFolder, SettingsFolder);

            if (!Directory.Exists(settingsFolder))
            {
                Directory.CreateDirectory(settingsFolder);
            }

            string settingsFile = Path.Combine(settingsFolder, SettingsFile);

            var res = SaveSettings(settings, settingsFile);

            if (res)
            {
                solutionSettings         = settings;
                settingsExistenceChecked = true;
            }
            return(res);
        }
Пример #2
0
        private void ManageUid()
        {
            OperationDescription = "Performing " + ManageUidOperation;
            StepDescription      = String.Format("Preparing files list...");

            solutionFolder = visualStudioAdapter.GetSolutionFolder();
            //solutionSettings = settingsService.GetSolutionSettings();

            var xamlFiles = new List <XamlFileDescription>();

            foreach (var projDescr in visualStudioAdapter.GetProjects())
            {
                if (settingsService.IsProjectHandled(projDescr))
                {
                    xamlFiles.AddRange(visualStudioAdapter.GetXamlFiles(projDescr));
                }
            }

            if (xamlFiles.Count == 0)
            {
                MessageBox.Show("No .xaml files in selected projects", "Easy BAML");
                return;
            }

            uidUpdateHandleStrategy = new DefaultUidUpdateHandleStrategy(ManageUidOperation == ManageUidOperation.RemoveUid);

            InvalidFiles = new ObservableCollection <XamlFileViewModel>();
            TotalSteps   = xamlFiles.Count;
            CurrentStep  = 0;
            foreach (var xamlFileDescription in xamlFiles)
            {
                UpdateStepDescription(xamlFileDescription);
                ManageFileUids(xamlFileDescription);
                CurrentStep++;
            }
            CurrentStep          = TotalSteps;
            OperationDescription = "Completed: " + ManageUidOperation;
            StepDescription      = "";
        }