コード例 #1
0
ファイル: WordFormsPanel.cs プロジェクト: kbogatyrev/Zal
        public void SetForm(string sKey, string sText, EM_Status eStatus)
        {
            try
            {
                switch (eStatus)
                {
                case EM_Status.STATUS_COMMON:
                {
                    break;
                }

                case EM_Status.STATUS_INCORRECT:
                {
                    sText += "*" + sText;
                    break;
                }

                case EM_Status.STATUS_OBSOLETE:
                {
                    sText += " (Obsolete)";
                    break;
                }

                case EM_Status.STATUS_QUESTIONABLE:
                {
                    sText += "?" + sText;
                    break;
                }

                case EM_Status.STATUS_RARE:
                {
                    sText += " (Rare)";
                    break;
                }
                }

                if (m_dictForms[sKey].m_SetContents.Contains(sText))
                {
                    return;
                }

                m_dictForms[sKey].m_SetContents.Add(sText);

                if (m_dictForms[sKey].m_TextboxTarget.Text.Length > 0)
                {
                    m_dictForms[sKey].m_TextboxTarget.Text += "\r\n";
                }
                m_dictForms[sKey].m_TextboxTarget.Text += sText;

                if (m_dictForms[sKey].m_TextboxTarget.Lines.Length > 1)
                {
                    m_dictForms[sKey].m_TextboxTarget.ScrollBars = ScrollBars.Vertical;
                }
                else
                {
                    m_dictForms[sKey].m_TextboxTarget.ScrollBars = ScrollBars.None;
                }
            }
            catch (Exception ex)
            {
//                MainLib.ZalError err = new MainLib.ZalError();
                string sMsg = "SetForm: ";
//                sMsg += err.LastError;
                sMsg += ex.Message;
                MessageBox.Show(sMsg, "Zal Error", MessageBoxButtons.OK);
                return;
            }
        } //  SetForm (...)
コード例 #2
0
        public void SetForm(string sKey, string sText, EM_Status eStatus)
        {
            try
            {
                switch (eStatus)
                {
                    case EM_Status.STATUS_COMMON:
                    {
                        break;
                    }
                    case EM_Status.STATUS_INCORRECT:
                    {
                        sText += "*" + sText;
                        break;
                    }
                    case EM_Status.STATUS_OBSOLETE:
                    {
                        sText += " (Obsolete)";
                        break;
                    }
                    case EM_Status.STATUS_QUESTIONABLE:
                    {
                        sText += "?" + sText;
                        break;
                    }
                    case EM_Status.STATUS_RARE:
                    {
                        sText += " (Rare)";
                        break;
                    }
                }

                if (m_dictForms[sKey].m_SetContents.Contains(sText))
                {
                    return;
                }

                m_dictForms[sKey].m_SetContents.Add(sText);

                if (m_dictForms[sKey].m_TextboxTarget.Text.Length > 0)
                {
                    m_dictForms[sKey].m_TextboxTarget.Text += "\r\n";
                }
                m_dictForms[sKey].m_TextboxTarget.Text += sText;

                if (m_dictForms[sKey].m_TextboxTarget.Lines.Length > 1)
                {
                    m_dictForms[sKey].m_TextboxTarget.ScrollBars = ScrollBars.Vertical;
                }
                else
                {
                    m_dictForms[sKey].m_TextboxTarget.ScrollBars = ScrollBars.None;
                }

            }
            catch (Exception ex)
            {
            //                MainLib.ZalError err = new MainLib.ZalError();
                string sMsg = "SetForm: ";
            //                sMsg += err.LastError;
                sMsg += ex.Message;
                MessageBox.Show(sMsg, "Zal Error", MessageBoxButtons.OK);
                return;
            }
        }