public void ReadSetting() { RWSettingFile pri = new RWSettingFile(); string[] Setting = pri.ReadSetting(); if (Setting[0] == "true") { randomSlideShow = true; } else { randomSlideShow = false; } if (Setting[1] == "true") { loopSlideShow = true; } else { loopSlideShow = false; } if (Setting[3] == "true") { ShowClock = true; } else { ShowClock = false; } if (Setting[4] == "true") { BoolShowFolderName = true; } else { BoolShowFolderName = false; } if (Setting[5] == "true") { BoolShowFileName = true; } else { BoolShowFileName = false; } try { ImageSwitchTime = float.Parse(Setting[2].ToString()); } catch { MessageBox.Show("画像切替時間設定の値が不正です。\n切替時間3秒でスライドショーを開始します。", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); ImageSwitchTime = 3; } }
public void ReadSettings() { RWSettingFile pri = new RWSettingFile(); string[] Setting = pri.ReadSetting(); if (Setting[1] == "true") { CheckBoxLoop.IsChecked = true; } if (Setting[3] == "true") { CheckBoxShowClock.IsChecked = true; } if (Setting[0] == "true") { RadioButtonSortRandom.IsChecked = true; CheckBoxLoop.IsChecked = true; CheckBoxLoop.IsEnabled = false; } else { RadioButtonSort.IsChecked = true; } if (Setting[4] == "true") { CheckBoxDisplayFolder.IsChecked = true; } if (Setting[5] == "true") { CheckBoxDisplayFileName.IsChecked = true; } TextBoxImageChangeTime.Text = Setting[2].ToString(); //test int x = 0; foreach (string value in Setting) { // MessageBox.Show(x + "\n" + value); x++; } }