KbtterWPF.SettingWindow.ButtonOK_Click C# (CSharp) Method

ButtonOK_Click() private method

private ButtonOK_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void ButtonOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cfg["Kbtter.General.PreloadTimeline"]= int.Parse(TB_Preload.Text);
                cfg["Kbtter.General.TimelineMax"] = int.Parse(TB_MaxTweet.Text);
                cfg["Kbtter.General.MentionMax"] = int.Parse(TB_MaxTweet.Text);
                cfg["Kbtter.General.UserTweetsMax"] = int.Parse(TB_UserTweets.Text);
                cfg["Kbtter.General.UserFollowingShow"] = int.Parse(TB_UserFing.Text);
                cfg["Kbtter.General.UserFollowersShow"] = int.Parse(TB_UserFed.Text);
                cfg["Kbtter.General.UserFavoritesMax"] = int.Parse(TB_UserFavs.Text);
                cfg["Kbtter.General.SearchCount"] = int.Parse(TB_Preload.Text);
                cfg["Kbtter.General.ProtectedText"] = TB_ProtectedText.Text;

                cfg["Kbtter.Environment.MessageFile"] = TB_Lang.Text;

                cfg["Kbtter.Notifycation.ReplySound"] = TB_NotifyReply.Text;
                cfg["Kbtter.Notifycation.RetweetedSound"] = TB_NotifyRetweeted.Text;
                cfg["Kbtter.Notifycation.FavoritedSound"] = TB_NotifyFav.Text;
                cfg["Kbtter.Notifycation.UnfavoritedSound"] = TB_NotifyUnfav.Text;
                cfg["Kbtter.Notifycation.DMReceivedSound"] = TB_NotifyDM.Text;

                cfg.SaveFile("Kbtter.cfg");
            }
            catch (Exception ex)
            {
                MessageBox.Show("値の変換に失敗しました!正しい値が入力されているか確認して下さい。\n" + ex.Message, "エラー");
                return;
            }

            Close();
        }