コード例 #1
0
        /// <summary>
        /// Loads saved Settings.
        /// </summary>
        private void loadSettings()
        {
            // Load Scene-Configurations
            allSceneGames = Properties.Settings.Default.savedSceneGames;
            if (allSceneGames != null)
            {
                sceneNamesStr = new string[allSceneGames.Length];
                for (int i = 0; i < allSceneGames.Length; i++)
                {
                    sceneNamesStr[i] = allSceneGames[i][0];
                }
                for (int i = 0; i < allSceneGames.Length; i++)
                {
                    addSceneConfig(allSceneGames[i]);
                }
                if (missingGames != "Couldn't find the following Games:\n")
                {
                    MessageBox.Show(missingGames);
                }
            }
            else
            {
                allSceneGames    = new string[1][];
                allSceneGames[0] = new string[0];
            }

            // Load Utility-Applications
            System.Collections.ArrayList utilityApplications = Properties.Settings.Default.savedUtilityProcesses;
            if (utilityApplications != null)
            {
                controlLineList.loadAllUtilityApplications(utilityApplications, 0);
            }

            // Load Notification Sound-Setting
            cbxNotificationSound.Checked = Properties.Settings.Default.savedNotificationSound;

            // Load Start-On-Boot-Setting
            string      taskPath = Properties.Settings.Default.savedTaskPath;
            TaskService ts       = new TaskService();

            cbxStartOnBoot.Checked = ts.RootFolder.Tasks.Exists(taskPath);

            // Load OBS-Path
            tbxObsPath.setText(main.obsPath);

            // Load Port and Password
            tbxPort.setText(Properties.Settings.Default.savedPort.ToString());
            tbxPassword.setText(Properties.Settings.Default.savedPassword);
            cbxSavePassword.Checked = !tbxPassword.getText().Equals("");

            btnOK.Enabled    = false;
            btnApply.Enabled = false;
        }
コード例 #2
0
        public void loadAllUtilityApplications(System.Collections.ArrayList savedUA, int index)
        {
            bool             uApps   = false;
            bool             first   = true;
            bool             end     = false;
            StringCollection valColl = new StringCollection();
            string           key     = "";
            int i = 0;

            for (i = index; i < savedUA.Count && !end; i++)
            {
                if ((string)savedUA[i] == "game")
                {
                    if (uApps)
                    {
                        string[] copy = new string[valColl.Count];
                        valColl.CopyTo(copy, 0);
                        StringCollection loaded = new StringCollection();
                        loaded.AddRange(copy);
                        utilityApplications.Add(key, loaded);
                    }
                    valColl = new StringCollection();
                    i++;
                    key   = (string)savedUA[i];
                    uApps = true;
                }
                else if ((string)savedUA[i] == "line")
                {
                    first = !first;
                    end   = first;
                    if (end)
                    {
                        i--;
                    }
                }
                else if (uApps)
                {
                    valColl.Add((string)savedUA[i]);
                }
            }
            if (uApps)
            {
                string[] copy = new string[valColl.Count];
                valColl.CopyTo(copy, 0);
                StringCollection loaded = new StringCollection();
                loaded.AddRange(copy);
                utilityApplications.Add(key, loaded);
            }
            next.loadAllUtilityApplications(savedUA, i);
        }