public static void RunDaemonAsync() { ActiveSettings asettings = ActiveSettings.Deserialize(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KenMazaika\\VolumeOSD\\Settings.xml"); string themeName = asettings.Name; ProgramSettings settings = ProgramSettings.Deserialize(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KenMazaika\\VolumeOSD\\themes\\" + themeName + "\\ProgramSettings.xml"); foreach (DisplaySettings ds in settings.Settings) { frmDisplay form = new frmDisplay(ds, System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KenMazaika\\VolumeOSD\\themes\\" + settings.Name + "\\", asettings.X, asettings.Y, asettings.Opacity); System.Threading.Thread t = new System.Threading.Thread(RunForm); t.Start(form); } }
private void button1_Click(object sender, EventArgs e) { try { btnKillPreview.Enabled = true; btnPreview.Enabled = false; string themeName = comboBox1.Text; ProgramSettings settings = ProgramSettings.Deserialize(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KenMazaika\\VolumeOSD\\themes\\" + themeName + "\\ProgramSettings.xml"); forms = new Form[settings.Settings.Count]; for (int i = 0; i < settings.Settings.Count; i++) { DisplaySettings ds = settings.Settings[i]; frmDisplay form = new frmDisplay(ds, System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\KenMazaika\\VolumeOSD\\themes\\" + settings.Name + "\\", System.Convert.ToInt32(txtX.Text), System.Convert.ToInt32(txtY.Text), System.Convert.ToDouble(txtOpacity.Text) ); form.Visible = true; form.ShowIcon = true; form.ShowInTaskbar = true; Thread t = new Thread(new ParameterizedThreadStart(RunForm)); forms[i] = form; t.Start(form); } } catch (Exception) { MessageBox.Show("The display failed. Please validate data"); } }