public void SaveSetting() { try { Settings.Instance.ScrollSize = Convert.ToDouble(textBox_mouse_scroll.Text); Settings.Instance.MinHeight = Convert.ToDouble(textBox_minHeight.Text); Settings.Instance.ServiceWidth = Convert.ToDouble(textBox_service_width.Text); Settings.Instance.DragScroll = Convert.ToDouble(textBox_dragScroll.Text); Settings.Instance.MinimumHeight = Convert.ToDouble(textBox_minimumHeight.Text); if (checkBox_descToolTip.IsChecked == true) { Settings.Instance.EpgToolTip = true; } else { Settings.Instance.EpgToolTip = false; } if (checkBox_title_indent.IsChecked == true) { Settings.Instance.EpgTitleIndent = true; } else { Settings.Instance.EpgTitleIndent = false; } if (checkBox_toolTip_noView_only.IsChecked == true) { Settings.Instance.EpgToolTipNoViewOnly = true; } else { Settings.Instance.EpgToolTipNoViewOnly = false; } Settings.Instance.EpgToolTipViewWait = Convert.ToInt32(textBox_toolTipWait.Text); Settings.Instance.ContentColorList[0x00] = ((ColorSelectionItem)(comboBox0.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x01] = ((ColorSelectionItem)(comboBox1.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x02] = ((ColorSelectionItem)(comboBox2.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x03] = ((ColorSelectionItem)(comboBox3.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x04] = ((ColorSelectionItem)(comboBox4.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x05] = ((ColorSelectionItem)(comboBox5.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x06] = ((ColorSelectionItem)(comboBox6.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x07] = ((ColorSelectionItem)(comboBox7.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x08] = ((ColorSelectionItem)(comboBox8.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x09] = ((ColorSelectionItem)(comboBox9.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0A] = ((ColorSelectionItem)(comboBox10.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0B] = ((ColorSelectionItem)(comboBox11.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0F] = ((ColorSelectionItem)(comboBox12.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x10] = ((ColorSelectionItem)(comboBox13.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNormal = ((ColorSelectionItem)(comboBox_reserveNormal.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNo = ((ColorSelectionItem)(comboBox_reserveNo.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNoTuner = ((ColorSelectionItem)(comboBox_reserveNoTuner.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorWarning = ((ColorSelectionItem)(comboBox_reserveWarning.SelectedItem)).ColorName; Settings.Instance.TitleColor1 = ((ColorSelectionItem)(comboBox_colorTitle1.SelectedItem)).ColorName; Settings.Instance.TitleColor2 = ((ColorSelectionItem)(comboBox_colorTitle2.SelectedItem)).ColorName; if (checkBox_reserveBackground.IsChecked == true) { Settings.Instance.ReserveRectBackground = true; } else { Settings.Instance.ReserveRectBackground = false; } if (comboBox_font.SelectedItem != null) { Settings.Instance.FontName = comboBox_font.SelectedItem as string; } Settings.Instance.FontSize = Convert.ToDouble(textBox_fontSize.Text); if (comboBox_fontTitle.SelectedItem != null) { Settings.Instance.FontNameTitle = comboBox_fontTitle.SelectedItem as string; } Settings.Instance.FontSizeTitle = Convert.ToDouble(textBox_fontSizeTitle.Text); if (checkBox_fontBoldTitle.IsChecked == true) { Settings.Instance.FontBoldTitle = true; } else { Settings.Instance.FontBoldTitle = false; } if (radioButton_1_cust.IsChecked == true) { Settings.Instance.UseCustomEpgView = true; } else { Settings.Instance.UseCustomEpgView = false; } Settings.Instance.CustomEpgTabList.Clear(); foreach (CustomEpgTabInfo info in listBox_tab.Items) { Settings.Instance.CustomEpgTabList.Add(info); } Settings.Instance.ContentCustColorList.Clear(); UInt32 argb = 0; foreach (Color info in custColorList) { argb = CommonManager.CreateARGBKey(0xFF, info.R, info.G, info.B); Settings.Instance.ContentCustColorList.Add(argb); } argb = CommonManager.CreateARGBKey(0xFF, custTitleColor1.R, custTitleColor1.G, custTitleColor1.B); Settings.Instance.TitleCustColor1 = argb; argb = CommonManager.CreateARGBKey(0xFF, custTitleColor2.R, custTitleColor2.G, custTitleColor2.B); Settings.Instance.TitleCustColor2 = argb; if (checkBox_singleOpen.IsChecked == true) { Settings.Instance.EpgInfoSingleClick = true; } else { Settings.Instance.EpgInfoSingleClick = false; } if (checkBox_openInfo.IsChecked == true) { Settings.Instance.EpgInfoOpenMode = 1; } else { Settings.Instance.EpgInfoOpenMode = 0; } if (checkBox_scrollAuto.IsChecked == true) { Settings.Instance.MouseScrollAuto = true; } else { Settings.Instance.MouseScrollAuto = false; } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }
public void SaveSetting() { try { Settings.Instance.ScrollSize = Convert.ToDouble(textBox_mouse_scroll.Text); Settings.Instance.MinHeight = Convert.ToDouble(textBox_minHeight.Text); Settings.Instance.ServiceWidth = Convert.ToDouble(textBox_service_width.Text); Settings.Instance.DragScroll = Convert.ToDouble(textBox_dragScroll.Text); Settings.Instance.MinimumHeight = Convert.ToDouble(textBox_minimumHeight.Text); if (checkBox_title_indent.IsChecked == true) { Settings.Instance.EpgTitleIndent = true; } else { Settings.Instance.EpgTitleIndent = false; } if (checkBox_gradation.IsChecked == true) { Settings.Instance.EpgGradation = true; } else { Settings.Instance.EpgGradation = false; } Settings.Instance.ContentColorList[0x00] = ((ColorSelectionItem)(comboBox0.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x01] = ((ColorSelectionItem)(comboBox1.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x02] = ((ColorSelectionItem)(comboBox2.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x03] = ((ColorSelectionItem)(comboBox3.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x04] = ((ColorSelectionItem)(comboBox4.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x05] = ((ColorSelectionItem)(comboBox5.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x06] = ((ColorSelectionItem)(comboBox6.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x07] = ((ColorSelectionItem)(comboBox7.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x08] = ((ColorSelectionItem)(comboBox8.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x09] = ((ColorSelectionItem)(comboBox9.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0A] = ((ColorSelectionItem)(comboBox10.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0B] = ((ColorSelectionItem)(comboBox11.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x0F] = ((ColorSelectionItem)(comboBox12.SelectedItem)).ColorName; Settings.Instance.ContentColorList[0x10] = ((ColorSelectionItem)(comboBox13.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNormal = ((ColorSelectionItem)(comboBox_reserveNormal.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNo = ((ColorSelectionItem)(comboBox_reserveNo.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorNoTuner = ((ColorSelectionItem)(comboBox_reserveNoTuner.SelectedItem)).ColorName; Settings.Instance.ReserveRectColorWarning = ((ColorSelectionItem)(comboBox_reserveWarning.SelectedItem)).ColorName; Settings.Instance.TitleColor1 = ((ColorSelectionItem)(comboBox_colorTitle1.SelectedItem)).ColorName; Settings.Instance.TitleColor2 = ((ColorSelectionItem)(comboBox_colorTitle2.SelectedItem)).ColorName; if (checkBox_reserveBackground.IsChecked == true) { Settings.Instance.ReserveRectBackground = true; } else { Settings.Instance.ReserveRectBackground = false; } if (comboBox_font.SelectedItem != null) { Settings.Instance.FontName = comboBox_font.SelectedItem as string; } Settings.Instance.FontSize = Convert.ToDouble(textBox_fontSize.Text); if (comboBox_fontTitle.SelectedItem != null) { Settings.Instance.FontNameTitle = comboBox_fontTitle.SelectedItem as string; } Settings.Instance.FontSizeTitle = Convert.ToDouble(textBox_fontSizeTitle.Text); if (checkBox_fontBoldTitle.IsChecked == true) { Settings.Instance.FontBoldTitle = true; } else { Settings.Instance.FontBoldTitle = false; } if (radioButton_1_cust.IsChecked == true) { Settings.Instance.UseCustomEpgView = true; IniFileHandler.WritePrivateProfileString("HTTP", "HttpCustEpg", "1", SettingPath.TimerSrvIniPath); } else { Settings.Instance.UseCustomEpgView = false; IniFileHandler.WritePrivateProfileString("HTTP", "HttpCustEpg", "0", SettingPath.TimerSrvIniPath); } Settings.Instance.CustomEpgTabList.Clear(); int custCount = listBox_tab.Items.Count; IniFileHandler.WritePrivateProfileString("HTTP", "HttpCustCount", custCount.ToString(), SettingPath.TimerSrvIniPath); custCount = 0; foreach (CustomEpgTabInfo info in listBox_tab.Items) { Settings.Instance.CustomEpgTabList.Add(info); IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "Name", info.TabName, SettingPath.TimerSrvIniPath); IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "ViewServiceCount", info.ViewServiceList.Count.ToString(), SettingPath.TimerSrvIniPath); int serviceCount = 0; foreach (Int64 id in info.ViewServiceList) { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "ViewService" + serviceCount.ToString(), id.ToString(), SettingPath.TimerSrvIniPath); serviceCount++; } IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "ContentCount", info.ViewContentKindList.Count.ToString(), SettingPath.TimerSrvIniPath); int contentCount = 0; foreach (UInt16 id in info.ViewContentKindList) { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "Content" + contentCount.ToString(), id.ToString(), SettingPath.TimerSrvIniPath); contentCount++; } IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "ViewMode", info.ViewMode.ToString(), SettingPath.TimerSrvIniPath); if (info.NeedTimeOnlyBasic == true) { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "NeedTimeOnlyBasic", "1", SettingPath.TimerSrvIniPath); } else { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "NeedTimeOnlyBasic", "0", SettingPath.TimerSrvIniPath); } if (info.NeedTimeOnlyWeek == true) { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "NeedTimeOnlyWeek", "1", SettingPath.TimerSrvIniPath); } else { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "NeedTimeOnlyWeek", "0", SettingPath.TimerSrvIniPath); } if (info.SearchMode == true) { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "SearchMode", "1", SettingPath.TimerSrvIniPath); } else { IniFileHandler.WritePrivateProfileString("HTTP_CUST" + custCount.ToString(), "SearchMode", "0", SettingPath.TimerSrvIniPath); } custCount++; } Settings.Instance.ContentCustColorList.Clear(); UInt32 argb = 0; foreach (Color info in custColorList) { argb = CommonManager.CreateARGBKey(0xFF, info.R, info.G, info.B); Settings.Instance.ContentCustColorList.Add(argb); } argb = CommonManager.CreateARGBKey(0xFF, custTitleColor1.R, custTitleColor1.G, custTitleColor1.B); Settings.Instance.TitleCustColor1 = argb; argb = CommonManager.CreateARGBKey(0xFF, custTitleColor2.R, custTitleColor2.G, custTitleColor2.B); Settings.Instance.TitleCustColor2 = argb; if (checkBox_singleOpen.IsChecked == true) { Settings.Instance.EpgInfoSingleClick = true; } else { Settings.Instance.EpgInfoSingleClick = false; } if (checkBox_openInfo.IsChecked == true) { Settings.Instance.EpgInfoOpenMode = 1; } else { Settings.Instance.EpgInfoOpenMode = 0; } if (checkBox_scrollAuto.IsChecked == true) { Settings.Instance.MouseScrollAuto = true; } else { Settings.Instance.MouseScrollAuto = false; } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }