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

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

            packageContext.ControlSettingsChanged += OnControlSettingsChanged;
        }
 private void ToolInitialize()
 {
     try
     {
         _controlSettings = LoadSettings(this);
         ToolWindowPane toolWindow = GetToolWindow();
         IPackageContext packageContext = this;
         ControlViewModel viewModel = ToolWindow.GetViewModel(toolWindow);
         var buildContext = new BuildContext(packageContext, viewModel.FindProjectItem);
         var tool = new Tool.Tool(packageContext, buildContext, buildContext, viewModel);
     }
     catch (Exception ex)
     {
         ex.TraceUnknownException();
     }
 }
        /// <remarks>
        /// Settings are stored under "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\[12.0Exp]\BuildVision\".
        /// </remarks>
        private static void SaveSettings(ControlSettings settings, IServiceProvider serviceProvider)
        {
            WritableSettingsStore store = GetWritableSettingsStore(serviceProvider);
            if (!store.CollectionExists(SettingsCategoryName))
                store.CreateCollection(SettingsCategoryName);

            string value = settings.Serialize();
            store.SetString(SettingsCategoryName, SettingsPropertyName, value);
        }
 /// <summary>
 /// Uses as design-time ViewModel. 
 /// </summary>
 internal ControlViewModel()
 {
     _model = new ControlModel();
     _settings = new ControlSettings();
     _buildProgressViewModel = new BuildProgressViewModel(_settings);
 }
 public BuildProgressViewModel(ControlSettings settings)
 {
     _settings = settings;
 }