private void tbLinks_TextChanged(object sender, EventArgs e) { try { bool result; Common.Env.LinkintEditorText = tbLinks.Text; LastLinks = Disp.Compile(tbLinks.Text, true, out result); bool is_good; if (Disp.Errors != null) { lbErrorInfo.Text = Disp.Errors; is_good = false; lbErrorInfo.ForeColor = Color.Red; lbErrorInfo.BackColor = Color.White; } else { lbErrorInfo.Text = Common.MLS.Get(MLSConst, "Ошибок не найдено"); is_good = true; lbErrorInfo.ForeColor = SystemColors.ControlText; lbErrorInfo.BackColor = SystemColors.Control; } tbLinks.ForeColor = lbErrorInfo.ForeColor; mmCommonUseMatrix.Enabled = is_good; //SetupMarkers();//false); ApplyDispers(); } catch (Exception ex) { Common.Log(ex); } }
private void tbLinks_TextChanged(object sender, EventArgs e) { try { bool result; Common.Env.LinkingEditorGlobalLyText = tbLinks.Text; LastLinks = Disp.Compile(tbLinks.Text, true, out result, false); bool is_good; if (Disp.Errors != null) { lbErrorInfo.Text = Disp.Errors; is_good = false; lbErrorInfo.ForeColor = Color.Red; lbErrorInfo.BackColor = Color.White; } else { if (LastLinks.Count > 1) { lbErrorInfo.Text = Common.MLS.Get(MLSConst, "Ошибок не найдено..."); is_good = true; } else { lbErrorInfo.Text = Common.MLS.Get(MLSConst, "Ошибок не найдено. Но мало линий..."); is_good = false; } lbErrorInfo.ForeColor = SystemColors.ControlText; lbErrorInfo.BackColor = SystemColors.Control; } tbLinks.ForeColor = lbErrorInfo.ForeColor; btOk.Enabled = is_good; } catch (Exception ex) { Common.LogNoMsg(ex); } }