Example #1
0
        public GamestreamLauncherWindow(bool restore = false, string applicationToLaunch = null)
        {
            InitializeComponent();

            var oVersion = Assembly.GetExecutingAssembly().GetName().Version;
            var version  = "v" + oVersion.Major + "." + oVersion.Minor;

            isRestore = restore;

            LoadConfig(applicationToLaunch);

            lblVersion.Content = version;
            lblHeader.Content  = appName + " Launcher";

            launcherApi = restore ? new LauncherApi(Properties.Settings.Default.MonitorsDisabled, Properties.Settings.Default.MinersDisabled) : new LauncherApi();

            // configure callbacks
            launcherApi.MonitorInfoLoaded       += MonitorInfoLoaded;
            launcherApi.MonitorModeSingle       += MonitorModeSingle;
            launcherApi.MonitorModeMulti        += MonitorModeMulti;
            launcherApi.MinerInfoLoaded         += MinerInfoLoaded;
            launcherApi.MinerDisabled           += MinerDisabled;
            launcherApi.MinerEnabled            += MinerEnabled;
            launcherApi.StartupScriptsFinished  += StartupScriptsFinished;
            launcherApi.ShutdownScriptsFinished += ShutdownScriptsFinished;
            launcherApi.ApplicationStarted      += ApplicationStarted;
            launcherApi.ApplicationStopped      += ApplicationStopped;
            launcherApi.StreamClosed            += StreamClosed;

            if (!testUI)
            {
                if (restore)
                {
                    EndWorkFlow();
                }
                else
                {
                    StartWorkflow();
                }
            }
        }