private bool parseToFont(string fontstr, out string fontName, out float emSize, out FontStyle fontStyle) { bool success = true; string[] arrFont = fontstr.Split("^".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); string[] rgbs = arrFont[0].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (rgbs.Length < 2) { fontName = ""; emSize = 0; fontStyle = FontStyle.Regular; } else { fontName = rgbs[0].Trim(); fontStyle = FontStyle.Regular; if (!float.TryParse(rgbs[1].Trim(), out emSize)) { success = false; } if (rgbs.Length > 2) { fontStyle = EnumAdapter.GetEnum <FontStyle>(rgbs[2].Trim()); } } return(success); }
private void btnOk_Click(object sender, EventArgs e) { // RemindType rt = EnumAdapter.GetEnum <RemindType>(e0571.web.core.Utils.TypeConverter.ChangeString(cbRemindType.SelectedValue)); if (SectionBizSettingsSave != null) { SectionBizSettingsSave(this, new SectionBizSettingsSaveEventArgs { Type = rt, YYRemindFlag = (chkPlayYY.Checked ? 1 : 0) }); } this.DialogResult = DialogResult.OK; this.Close(); }
private void ReadSettings() { string strAssistToolbarFlag = INIAdapter.ReadValue(Common.INI_SECTION_LOCAL, Common.INT_KEY_ASSIST_TOOLBAR_FLAG, Common.INI_FILE_PATH); if (!string.IsNullOrEmpty(strAssistToolbarFlag)) { assistToolbarState = EnumAdapter.GetEnum <CheckState>(strAssistToolbarFlag); } string strAssistToolbarPositionLast = INIAdapter.ReadValue(Common.INI_SECTION_LOCAL, Common.INT_KEY_ASSIST_TOOLBAR_POSITION_LAST, Common.INI_FILE_PATH); if (!string.IsNullOrEmpty(strAssistToolbarPositionLast)) { string[] positions = strAssistToolbarPositionLast.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); pnlAssistToolbarContainer.Location = new Point(int.Parse(positions[0]), int.Parse(positions[1])); } else { pnlAssistToolbarContainer.Location = new Point(pnlMain.Width - pnlAssistToolbarContainer.Width, 0); } }
private void btnOk_Click(object sender, EventArgs e) { // string authEndPoint = formatAuthEndPoint(); RemindType rt = EnumAdapter.GetEnum <RemindType>(e0571.web.core.Utils.TypeConverter.ChangeString(cbRemindType.SelectedValue)); string connectUrl = authEndPoint + "/"; HttpAdapter.optionsAsyncTo(connectUrl, new { ApplicationId = Common.APPLICATION_ID }.ToStringObjectDictionary(), (ret, res) => { if (ret != "ok") { MessageBoxAdapter.ShowError("无效的认证节点"); return; } if (SectionWebSettingsSave != null) { SectionWebSettingsSave(this, new SectionWebSettingsSaveEventArgs { AuthEndPoint = authEndPoint }); } if (SectionBizSettingsSave != null) { SectionBizSettingsSave(this, new SectionBizSettingsSaveEventArgs { Type = rt, YYRemindFlag = (chkPlayYY.Checked ? 1 : 0) }); } this.DialogResult = DialogResult.OK; this.UIInvoke(() => { this.Close(); }); }); }