KbtterWPF.MainWindow.LoadConfig C# (CSharp) Method

LoadConfig() private method

private LoadConfig ( ) : void
return void
        private void LoadConfig()
        {
            if (!Directory.Exists("tegaki"))
            {
                Directory.CreateDirectory("tegaki");
            }

            if (!File.Exists("Kbtter.cfg"))
            {
                Settings = GetDefaultConfig();
                Settings.SaveFile("Kbtter.cfg");
            }
            Settings.LoadFile("Kbtter.cfg");

            PreloadTimelineCount = (int)Settings["Kbtter.General.PreloadTimeline"].NumberValue;
            TimelineMax = (int)Settings["Kbtter.General.TimelineMax"].NumberValue;
            MentionMax = (int)Settings["Kbtter.General.MentionMax"].NumberValue;
            ListTweetCount = (int)Settings["Kbtter.General.UserTweetsMax"].NumberValue;
            ListFollowingCount = (int)Settings["Kbtter.General.UserFollowingShow"].NumberValue;
            ListFollowersCount = (int)Settings["Kbtter.General.UserFollowersShow"].NumberValue;
            ListFavoriteCount = (int)Settings["Kbtter.General.UserFavoritesMax"].NumberValue;
            SearchCount = (int)Settings["Kbtter.General.SearchCount"].NumberValue;
            MessageInfoProtectedText = Settings["Kbtter.General.ProtectedText"].StringValue;

            NotifySoundReply = Settings["Kbtter.Notifycation.ReplySound"].StringValue;
            NotifySoundRetweeted = Settings["Kbtter.Notifycation.RetweetedSound"].StringValue;
            NotifySoundFavorited = Settings["Kbtter.Notifycation.FavoritedSound"].StringValue;
            NotifySoundUnfavorited = Settings["Kbtter.Notifycation.UnfavoritedSound"].StringValue;
            NotifySoundDMReceived = Settings["Kbtter.Notifycation.DMReceivedSound"].StringValue;

            if (NotifySoundReply != "") NotifySoundReplyPlayer = new SoundPlayer(NotifySoundReply);
            if (NotifySoundRetweeted != "") NotifySoundRetweetedPlayer = new SoundPlayer(NotifySoundRetweeted);
            if (NotifySoundFavorited != "") NotifySoundFavoritedPlayer = new SoundPlayer(NotifySoundFavorited);
            if (NotifySoundUnfavorited != "") NotifySoundUnfavoritedPlayer = new SoundPlayer(NotifySoundUnfavorited);
            if (NotifySoundDMReceived != "") NotifySoundDMReceivedPlayer = new SoundPlayer(NotifySoundDMReceived);

            LoadMessages(Settings["Kbtter.Environment.MessageFile"].StringValue);
        }