Beispiel #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                CharacterInfo characterSheet = CharacterInfoProvider.LoadFrom(comboRealmSelection.SelectedValue as string, textCharacterName.Text as string);
                Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software").CreateSubKey("SEWilson").CreateSubKey("ScreenSaver").SetValue("ArmoryRealmName", comboRealmSelection.SelectedValue as string);
                Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software").CreateSubKey("SEWilson").CreateSubKey("ScreenSaver").SetValue("ArmoryCharacterName", textCharacterName.Text);
                Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software").CreateSubKey("SEWilson").CreateSubKey("ScreenSaver").SetValue("ArmoryBackgroundsFolder", textBackgroundsPath.Text);

                UpdateArmoryMRU(comboRealmSelection.SelectedValue as string, textCharacterName.Text as string);

                this.Close();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message + Environment.NewLine + ex.StackTrace);
                Util.UI.ExceptionInspectorWindow.Inspect(ex);
            }
        }
 private void LoadCharacterInfo(string realmName, string characterName)
 {
     realmName     = realmName.Trim();
     characterName = characterName.Trim();
     // load character sheet, and use as the binding target for the specified UIElement
     if (characterInfoList.Where((c) => c.Realm.Equals(realmName) && c.Name.Equals(characterName)).Count() == 0)
     {
         CharacterInfo characterInfo = CharacterInfoProvider.LoadFrom(realmName, characterName);
         this.Dispatcher.Invoke((ThreadStart) delegate()
         {
             lock (characterInfoList)
             {
                 if (characterInfoList.Where((c) => c.Realm.ToLower() == realmName.ToLower() && c.Name.ToLower() == characterName.ToLower()).Count() == 0)
                 {
                     characterInfoList.Add(characterInfo);
                 }
             }
         });
     }
 }