Пример #1
0
        public static void ShowTextFileViewer(MainForm frm)
        {
            TextFileViewer textoutForm = null;
            //string filename = @"c:\testfiles\testfile.txt";
            string filename = @"c:\testfiles\FirstNamesShort.txt";

            try
            {
                _msg.Length = 0;
                _msg.Append("ShowTextFileViewer started ...\r\n");
                Program._messageLog.WriteLine(_msg.ToString());

                textoutForm          = new TextFileViewer();
                textoutForm.Caption  = "Test Progam for PFTextFileViewer ...";
                textoutForm.Font     = "Lucida Console";
                textoutForm.FontSize = (float)10.0;

                textoutForm.LoadFile(filename);

                textoutForm.ShowDialog();
                textoutForm.CloseWindow();
                textoutForm = null;
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                Program._messageLog.WriteLine(_msg.ToString());
                AppMessages.DisplayErrorMessage(_msg.ToString(), _saveErrorMessagesToAppLog);
            }
            finally
            {
                if (textoutForm != null)
                {
                    if (textoutForm.FormIsVisible)
                    {
                        textoutForm.CloseWindow();
                    }
                    textoutForm = null;
                }
                _msg.Length = 0;
                _msg.Append("\r\n... ShowTextFileViewer finished.");
                Program._messageLog.WriteLine(_msg.ToString());
            }
        }
Пример #2
0
        private void BtnLicense_Click(object sender, RoutedEventArgs e)
        {
            string dir = AppInfo.AppDirectory;

            TextFileViewer.ViewTextFile(Path.Combine(dir, "License.txt"));
        }
Пример #3
0
 private async void BtnLog_Click(object sender, RoutedEventArgs e)
 {
     _ = await TextFileViewer.ViewTextFile(NLHelpers.GetLogfileName()).ConfigureAwait(true);
 }
Пример #4
0
    private async void BtnReadme_Click(object sender, RoutedEventArgs e)
    {
        string dir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

        _ = await TextFileViewer.ViewTextFile(Path.Combine(dir, "ReadMe.txt")).ConfigureAwait(true);
    }
Пример #5
0
    private async void BtnLicense_Click(object sender, RoutedEventArgs e)
    {
        string dir = AppInfo.AppDirectory;

        _ = await TextFileViewer.ViewTextFile(Path.Combine(dir, "License.txt")).ConfigureAwait(true);
    }