/// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            IProjectInfoProvider solutionInfoProvider = new SolutionInfoProvider(this);
            IProjectInfoProvider projectInfoProvider  = new ProjectInfoProvider(this);
            IProjectInfoProvider fileInfoProvider     = new FileInfoProvider(this);

            IProjectInfoProvider solutionSnapshotInfoProvider = new SolutionInfoProvider(this, true);
            IProjectInfoProvider projectSnapshotInfoProvider  = new ProjectInfoProvider(this, true);

            IDexterInfoProvider dexterInfoProvider = new SettingsStoreDexterInfoProvider(this);

            ConfigurationProvider solutionConfigProvider = new ConfigurationProvider(solutionInfoProvider, dexterInfoProvider);
            ConfigurationProvider projectConfigProvider  = new ConfigurationProvider(projectInfoProvider, dexterInfoProvider);
            ConfigurationProvider fileConfigProvider     = new ConfigurationProvider(fileInfoProvider, dexterInfoProvider);

            ConfigurationProvider solutionSnapshotConfigProvider = new ConfigurationProvider(solutionSnapshotInfoProvider, dexterInfoProvider);
            ConfigurationProvider projectSnapshotConfigProvider  = new ConfigurationProvider(projectSnapshotInfoProvider, dexterInfoProvider);

            var commandSet = new Guid("2ed6d891-bce1-414d-8251-80a0800a831f");

            DexterAnalysisCommand fileAnalysisCommand     = new DexterFileAnalysisCommand(this, 0x0102, commandSet, fileConfigProvider);
            DexterAnalysisCommand projectAnalysisCommand  = new DexterSolutionAnalysisCommand(this, 0x0101, commandSet, projectConfigProvider);
            DexterAnalysisCommand solutionAnalysisCommand = new DexterSolutionAnalysisCommand(this, 0x0100, commandSet, solutionConfigProvider);
            DexterAnalysisCommand projectSnapshotCommand  = new DexterSolutionAnalysisCommand(this, 0x0111, commandSet, projectSnapshotConfigProvider);
            DexterAnalysisCommand solutionSnapshotCommand = new DexterSolutionAnalysisCommand(this, 0x0110, commandSet, solutionSnapshotConfigProvider);

            settingsCommand  = new SettingsCommand(this, 0x0103, commandSet);
            dashboardCommand = new DashboardCommand(this, 0x0104, commandSet, dexterInfoProvider);
            cancelCommand    = new CancelCommand(this, 0x0105, commandSet);

            DexterAnalysisCommand solutionAnalysisToolbarCommand = new DexterSolutionAnalysisCommand(this, 0x0200, commandSet, solutionConfigProvider);

            settingsToolbarCommand  = new SettingsCommand(this, 0x0203, commandSet);
            dashboardToolbarCommand = new DashboardCommand(this, 0x0204, commandSet, dexterInfoProvider);
            cancelToolbarCommand    = new CancelCommand(this, 0x0205, commandSet);

            analysisCommands.Add(fileAnalysisCommand);
            analysisCommands.Add(projectAnalysisCommand);
            analysisCommands.Add(solutionAnalysisCommand);
            analysisCommands.Add(projectSnapshotCommand);
            analysisCommands.Add(solutionSnapshotCommand);
            analysisCommands.Add(solutionAnalysisToolbarCommand);

            foreach (DexterAnalysisCommand analysisCommand in analysisCommands)
            {
                analysisCommand.AnalysisStarted  += onAnalysisStarted;
                analysisCommand.AnalysisFinished += onAnalysisFinished;
            }

            SettingsPage settingsPage = (SettingsPage)GetDialogPage(typeof(SettingsPage));

            settingsPage.SettingsChanged += onSettingsChanged;

            PeerReviewService.Instance = new PeerReviewService(new DexterTextService());

            RegisterSolutionManager();
            CreateReviewCommentManager();

            base.Initialize();
        }
        protected override void GivenThat()
        {
            base.GivenThat();

            DeviceManager.Stub(manager => manager.GetDevice("my device"))
            .Return(Device);

            Device.Stub(device => device.OpenRead(@"foo\bar.abc"))
            .Return(SourceStream);

            var fileInfo = GenerateMock <IFileInfo>();

            fileInfo.Stub(info => info.Length)
            .Return(1234);
            FileInfoProvider.Stub(provider => provider.GetFileInfo(@"MTP:\my device\foo\bar.abc"))
            .Return(fileInfo);

            StreamHelper.Stub(helper => helper.OpenWrite(@"D:\foo2\bar.abc", true))
            .Return(DestinationStream);
        }