private void loadConfig() { int i; rootKey = Microsoft.Win32.Registry.CurrentUser; softwareKey = rootKey.CreateSubKey(@"SOFTWARE\Mono.mLedMatrix\lines"); i = 0; foreach (string key in softwareKey.GetSubKeyNames()) { string name, code, rss; bool active, loop; int num, time; RegistryKey tempkey; tempkey = rootKey.CreateSubKey(@"SOFTWARE\Mono.mLedMatrix\lines\" + key); num = (int)tempkey.GetValue("num", 0); time = (int)tempkey.GetValue("time", 0); loop = (string)tempkey.GetValue("loop", "True") == "True"; name = (string)tempkey.GetValue("name", ""); code = (string)tempkey.GetValue("code", ""); rss = (string)tempkey.GetValue("rss", ""); active = (string)tempkey.GetValue("active", "True") == "True"; user_lines.Add(new userLine(name, active, code, rss, num, loop, time)); Console.WriteLine(key); i++; } if (i == 0) { user_lines.Add(new userLine("Spiegel.de", false, "%c%r%8%h:%m:%s%n%g%-%R" , "http://www.spiegel.de/index.rss", user_lines.Count + 1, true, 10)); user_lines.Add(new userLine("kicker.de", false, "%c%r%8%h:%m:%s%n%g%-%R" , "http://rss.kicker.de/live/bundesliga", user_lines.Count + 1, true, 10)); user_lines.Add(new userLine("Uhrzeit", true, "%2%+%+%c%r%h:%m:%s" , "", user_lines.Count + 1, true, 10)); user_lines.Add(new userLine("Wetter", false, "%c%r%8%h:%m:%s%n%g%-%R" , "http://wetter.bjoern-b.de/daten.xml", user_lines.Count + 1, true, 10)); user_lines.Add(new userLine("Weihnachten", false, "%+%+%g%2%T%1%c%+%-%-%-%-%rFrohe%2 %g%+%+%+%T%n%r%1%c%-%-%-%-Weihnachten" , "", user_lines.Count + 1, false, 10)); } user_lines.Sort(); softwareKey = rootKey.CreateSubKey(@"SOFTWARE\Mono.mLedMatrix"); led_matrix_address = (string)softwareKey.GetValue("ip_address", "192.168.0.222"); led_matrix.setAddress(led_matrix_address); winamp.winamp_address = (string)softwareKey.GetValue("winamp_address", "localhost"); winamp.winamp_port = (int)softwareKey.GetValue("winamp_port", 4800); winamp.winamp_pass = (string)softwareKey.GetValue("winamp_pass", "pass"); entry_winamp_address.Text = winamp.winamp_address; entry_winamp_port.Text = winamp.winamp_port.ToString(); entry_winamp_pass.Text = winamp.winamp_pass; entry_address.Text = led_matrix_address; led_matrix.scroll_speed = (int)softwareKey.GetValue("scroll_speed", 10); hscale_shift_speed.Value = led_matrix.scroll_speed; //entry_static_text.Text = (string)softwareKey.GetValue("static_text") }
private void loadConfig() { rootKey = Microsoft.Win32.Registry.CurrentUser; softwareKey = rootKey.CreateSubKey(@"SOFTWARE\Mono.mLedMatrix"); led_matrix_address = (string)softwareKey.GetValue("ip_address", "192.168.0.222"); led_matrix.setAddress(led_matrix_address); winamp.winamp_address = (string)softwareKey.GetValue("winamp_address", "localhost"); winamp.winamp_port = (int)softwareKey.GetValue("winamp_port", 4800); winamp.winamp_pass = (string)softwareKey.GetValue("winamp_pass", "pass"); entry_winamp_address.Text = winamp.winamp_address; entry_winamp_port.Text = winamp.winamp_port.ToString(); entry_winamp_pass.Text = winamp.winamp_pass; entry_mpd.Text = (string)softwareKey.GetValue("mpd_address", "localhost"); entry_address.Text = led_matrix_address; led_matrix.scroll_speed = (int)softwareKey.GetValue("scroll_speed", 10); hscale_shift_speed.Value = led_matrix.scroll_speed; //entry_static_text.Text = (string)softwareKey.GetValue("static_text") }