Exemple #1
0
        private void EditorForm_Load(object sender, EventArgs e)
        {
            SetLanguage();
            Text = LangCtrl.GetString("dlg_MemoEditor", "Memo Editor");
            LoadVoices();
            if (DocList.Equals(null))
            {
                DocList = new List <DOCData>();
            }
            if (DocList.Count > 0)
            {
                int num = 0;
                mnu_LoadFile.Visible = false;
                mnu_Save.Visible     = false;
                try
                {
                    using (RPM_DataFile rpmDataFile = new RPM_DataFile())
                    {
                        foreach (DOCData doc in DocList)
                        {
                            FileMemo memo = rpmDataFile.GetMemo(doc.RecId);
                            if (PageBreak)
                            {
                                textControl1.Append(memo.Memo, StringStreamType.RichTextFormat, AppendSettings.StartWithNewSection);
                            }
                            else
                            {
                                textControl1.Append(memo.Memo, StringStreamType.RichTextFormat, AppendSettings.None);
                            }
                            IsReadOnly = true;
                            ++num;
                        }
                        textControl1.EditMode = EditMode.ReadOnly;
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                }
            }
            else
            {
                try
                {
                    if (!RTF.Equals(string.Empty))
                    {
                        textControl1.Load(RTF, StringStreamType.RichTextFormat);
                    }
                }
                catch
                {
                }
            }
            string stringData;

            textControl1.Save(out stringData, StringStreamType.RichTextFormat);
            Hash = stringData.GetHashCode();
            textControl1.BackgroundStyle = BackgroundStyle.ColorScheme;
            textControl1.BorderStyle     = TXTextControl.BorderStyle.None;
        }