示例#1
0
        private void SaveRtfText()
        {
            SaveFileDialog dialog = DialogFactory.GetSaveRtfDialog();

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    File.WriteAllText(dialog.FileName, this.Rtf);
                }
                catch (Exception ex)
                {
                    ShowError(ex);
                }
            }
        }
示例#2
0
        private void OpenRtfText()
        {
            OpenFileDialog dialog = DialogFactory.GetOpenRtfDialog();

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    var rtf = File.ReadAllText(dialog.FileName);
                    this.Rtf = rtf;
                }
                catch (Exception ex)
                {
                    ShowError(ex);
                }
            }
        }