Пример #1
0
        protected override void Load(MSBuildBasedProject project, string configuration, string platform)
        {
            var assemblyInfoFileName = GetAssemblyInfoFileName(project);

            if (string.IsNullOrEmpty(assemblyInfoFileName))
            {
                assemblyInfo = new AssemblyInfo();
                MessageService.ShowError("${res:Dialog.ProjectOptions.AssemblyInfo.AssemblyInfoNotFound}");
            }
            else
            {
                var assemblyInfoProvider = new AssemblyInfoProvider();
                assemblyInfo = assemblyInfoProvider.ReadAssemblyInfo(assemblyInfoFileName);
            }

            var assemblyInfoViewModel = new AssemblyInfoViewModel(assemblyInfo);

            assemblyInfoViewModel.PropertyChanged += OnAssemblyInfoChanged;
            DataContext = assemblyInfoViewModel;

            base.Load(project, configuration, platform);
        }
Пример #2
0
        protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
        {
            if (!CheckForValidationErrors())
            {
                return(false);
            }

            var assemblyInfoFileName = GetAssemblyInfoFileName(project);

            if (!string.IsNullOrEmpty(assemblyInfoFileName))
            {
                if (assemblyInfo != null)
                {
                    var assemblyInfoProvider = new AssemblyInfoProvider();
                    assemblyInfoProvider.MergeAssemblyInfo(assemblyInfo, assemblyInfoFileName);
                }
            }
            else
            {
                MessageService.ShowError("${res:Dialog.ProjectOptions.AssemblyInfo.AssemblyInfoNotFound}");
            }

            return(base.Save(project, configuration, platform));
        }