private void NewProfileButton_Click(object sender, EventArgs e) { // TODO: Open window with possibility to choose the mode Console.WriteLine("Opening window to create new profile..."); if (ProfileComboBox.Text == "Monolight") { MonoLight newProf = new MonoLight(); newProf.Color = new byte[] { 0x00, 0x00, 0x00 }; MonolightForm secForm = new MonolightForm(newProf); secForm.Show(); } else if (ProfileComboBox.Text == "Multilight") { MultiLight newProf = new MultiLight(); MultiLightForm multiForm = new MultiLightForm(newProf); multiForm.Show(); } else if (ProfileComboBox.Text == "Ambilight") { Ambilight newProf = new Ambilight(); AmbilightForm ambiForm = new AmbilightForm(newProf); ambiForm.Show(); } else { Console.WriteLine("No profile selected..."); } }
public AmbilightForm(Ambilight profile) { InitializeComponent(); GetMaxId(); this.newAmbi = profile; showData(); }
public bool LoadProfile(string profileName) { string mode = ""; // Read in mode of profile Console.WriteLine("Reading Mode of Profile: " + profileName); try { XDocument loadedXmlDoc = XDocument.Load(profileName); // Loading Mode mode = loadedXmlDoc.Element("LedProfile").Attribute("Mode").Value; } catch { } if (mode == "Ambilight") { active = 1; ambiProfile = new Ambilight(); Console.WriteLine("Mode set to " + mode); // Get profile data from xml file ambiProfile.LoadProfile(profileName); return(true); } else if (mode == "Monolight") { active = 2; monProfile = new MonoLight(); Console.WriteLine("Mode set to " + mode); // Get profile data from xml file monProfile.LoadProfile(profileName); // Open form window and show data //MonolightForm newForm = new MonolightForm(monProfile); //newForm.Show(); return(true); } else if (mode == "Multilight") { active = 3; multProfile = new MultiLight(); Console.WriteLine("Mode set to " + mode); // Get profile data from xml file multProfile.LoadProfile(profileName); return(true); } else { Console.WriteLine("Could not read mode..."); return(false); } }