Exemplo n.º 1
0
        /// <summary>
        /// Displays the root View.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            IExtendedWindowManager windowManager       = new ExtendedWindowManager();
            ILastFMClientFactory   lastFMClientFactory = new LastFMClientFactory();
            IScrobblerFactory      scrobblerFactory    = new ScrobblerFactory();
            ILocalFileFactory      localFileFactory    = new LocalFileFactory();
            IFileOperator          fileOperator        = new FileOperator();
            IDirectoryOperator     directoryOperator   = new DirectoryOperator();
            ISerializer <User>     userSerializer      = new DCSerializer <User>();
            MainViewModel          mainVM = new MainViewModel(windowManager, lastFMClientFactory, scrobblerFactory, localFileFactory, fileOperator, directoryOperator, userSerializer);

            windowManager.ShowWindow(new SystemTrayViewModel(windowManager, mainVM));
        }
        /// <summary>
        /// Displays the root View.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            IExtendedWindowManager windowManager     = new ExtendedWindowManager();
            ILastFMClient          client            = new LastFMClient(APIKEY, APISECRET);
            IScrobblerFactory      scrobblerFactory  = new ScrobblerFactory();
            ILocalFileFactory      localFileFactory  = new LocalFileFactory();
            IFileOperator          fileOperator      = new FileOperator();
            IDirectoryOperator     directoryOperator = new DirectoryOperator();
            ISerializer            userSerializer    = new DCSerializer();
            ILogger         logger         = new Logger("log.txt");
            IGitHubClient   gitHubClient   = new GitHubClient(new ProductHeaderValue("Last.fm-Scrubbler-WPF"));
            IProcessManager processManager = new ProcessManager();
            MainViewModel   mainVM         = new MainViewModel(windowManager, client, scrobblerFactory, localFileFactory, fileOperator,
                                                               directoryOperator, userSerializer, logger, gitHubClient, processManager);

            windowManager.ShowWindow(new SystemTrayViewModel(windowManager, mainVM));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Displays the root View.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            IExtendedWindowManager windowManager     = new ExtendedWindowManager();
            ILastFMClient          client            = new LastFMClient(APIKEY, APISECRET);
            IScrobblerFactory      scrobblerFactory  = new ScrobblerFactory();
            ILocalFileFactory      localFileFactory  = new LocalFileFactory();
            IFileOperator          fileOperator      = new FileOperator();
            IDirectoryOperator     directoryOperator = new DirectoryOperator();
            ISerializer            userSerializer    = new DCSerializer();
            ILogger                logger            = new Logger("log.txt");
            IGitHubClient          gitHubClient      = new GitHubClient(new ProductHeaderValue("Last.fm-Scrubbler-WPF"));
            IProcessManager        processManager    = new ProcessManager();
            IDiscogsDataBaseClient discogsClient     = new DiscogsClient.DiscogsClient(new TokenAuthenticationInformation("vcrTuxlCPCANcLDUDcbGSYBxbODkeyywIUtYAMxg"));

            MainViewModel mainVM = new MainViewModel(windowManager, client, scrobblerFactory, localFileFactory, fileOperator,
                                                     directoryOperator, userSerializer, logger, gitHubClient, processManager, discogsClient);

            windowManager.ShowWindow(new SystemTrayViewModel(windowManager, mainVM));
        }