public ControlViewModel(ControlModel model, IPackageContext packageContext)
        {
            _model          = model;
            _packageContext = packageContext;

            _settings = packageContext.ControlSettings;
            _buildProgressViewModel = new BuildProgressViewModel(_settings);

            packageContext.ControlSettingsChanged += OnControlSettingsChanged;
        }
        public ControlViewModel(ControlModel model, IPackageContext packageContext)
        {
            _model = model;
            _packageContext = packageContext;

            _settings = packageContext.ControlSettings;
            _buildProgressViewModel = new BuildProgressViewModel(_settings);

            packageContext.ControlSettingsChanged += OnControlSettingsChanged;
        }
        public void OnBuildBegin(BuildInfo buildContext)
        {
            _buildState = BuildState.InProgress;
            _buildInfo  = buildContext;

            int projectsCount = -1;

            switch (buildContext.BuildScope)
            {
            case vsBuildScope.vsBuildScopeSolution:
                if (ControlSettings.GeneralSettings.FillProjectListOnBuildBegin)
                {
                    projectsCount = ProjectsList.Count;
                }
                else
                {
                    try
                    {
                        Solution solution = SolutionItem.StorageSolution;
                        if (solution != null)
                        {
                            projectsCount = solution.GetProjects().Count;
                        }
                    }
                    catch (Exception ex)
                    {
                        ex.Trace("Unable to count projects in solution.");
                    }
                }
                break;

            case vsBuildScope.vsBuildScopeBatch:
            case vsBuildScope.vsBuildScopeProject:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            BuildProgressViewModel.OnBuildBegin(projectsCount);
        }
 /// <summary>
 /// Uses as design-time ViewModel.
 /// </summary>
 internal ControlViewModel()
 {
     _model    = new ControlModel();
     _settings = new ControlSettings();
     _buildProgressViewModel = new BuildProgressViewModel(_settings);
 }
 public void OnBuildCancelled(BuildInfo buildInfo)
 {
     _buildInfo = buildInfo;
     BuildProgressViewModel.OnBuildCancelled();
 }
 public void OnBuildDone(BuildInfo buildInfo)
 {
     _buildInfo  = buildInfo;
     _buildState = BuildState.Done;
     BuildProgressViewModel.OnBuildDone();
 }
        public void OnBuildProjectDone(BuildedProject buildedProjectInfo)
        {
            bool success = buildedProjectInfo.Success.GetValueOrDefault(true);

            BuildProgressViewModel.OnBuildProjectDone(success);
        }
 public void OnBuildProjectBegin()
 {
     BuildProgressViewModel.OnBuildProjectBegin();
 }
 /// <summary>
 /// Uses as design-time ViewModel. 
 /// </summary>
 internal ControlViewModel()
 {
     _model = new ControlModel();
     _settings = new ControlSettings();
     _buildProgressViewModel = new BuildProgressViewModel(_settings);
 }