示例#1
0
        public void HTMLDisplay()
        {
            Extensions.RunSTAThread(() =>
            {
                using (var tm = new TimedMessage())
                {
                    var stringBuilder = HTMLStyle.StartHTMLDoc(SystemColors.Control, "");
                    stringBuilder.Append(string.Format(UnitTestInitializeWin.HTMLStyle.H2, HTMLStyle.TextToHtmlEncode("Sample")));
                    stringBuilder.Append(string.Format(UnitTestInitializeWin.HTMLStyle.H2, HTMLStyle.TextToHtmlEncode("Sample2")));

                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TableOpen);
                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TROpen);
                    for (var index = 1; index <= 10; index++)
                    {
                        stringBuilder.AppendLine(string.Format(UnitTestInitializeWin.HTMLStyle.TD,
                                                               HTMLStyle.TextToHtmlEncode("Test " + index.ToString())));
                        if (index % 4 == 0)
                        {
                            stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TRClose);
                        }
                    }

                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TRClose);
                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TableClose);
                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TableClose);
                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TRClose);
                    stringBuilder.AppendLine(UnitTestInitializeWin.HTMLStyle.TableClose);
                    tm.Html = stringBuilder.ToString();

                    tm.Size = new Size(600, 450);
                    UnitTestWinFormHelper.ShowFormAndClose(tm, 2);
                }
            });
        }
示例#2
0
 public void FormShowMaxLength()
 {
     using (var dataTable = UnitTestStatic.GetDataTable(60))
         using (var form = new FormShowMaxLength(dataTable, dataTable.Select(), new List <string>(), UnitTestInitializeWin.HTMLStyle))
         {
             UnitTestWinFormHelper.ShowFormAndClose(form);
         }
 }
示例#3
0
 public void FormUniqueDisplay()
 {
     using (var dataTable = UnitTestStatic.GetDataTable(60))
         using (var form = new FormUniqueDisplay(dataTable, dataTable.Select(), dataTable.Columns[0].ColumnName, UnitTestInitializeWin.HTMLStyle))
         {
             UnitTestWinFormHelper.ShowFormAndClose(form);
         }
 }
示例#4
0
 public void CsvTextDisplayShow()
 {
     using (var frm = new FormCsvTextDisplay(UnitTestInitializeCsv.GetTestPath("BasicCSV.txt")))
     {
         UnitTestWinFormHelper.ShowFormAndClose(frm, .2,
                                                (f) => f.OpenFile(false, "\"", "\t", "", 1200, 1, "##"));
     }
 }
 public void FormEditSettings()
 {
     Extensions.RunSTAThread(() =>
     {
         using (var frm = new FormEditSettings(new ViewSettings()))
         {
             UnitTestWinFormHelper.ShowFormAndClose(frm);
         }
     });
 }
示例#6
0
 public void ResizeForm()
 {
     using (var frm = new ResizeForm())
     {
         UnitTestWinFormHelper.ShowFormAndClose(frm, .2, (from) =>
         {
             CsvTools.ResizeForm.SetFonts(from, SystemFonts.DialogFont);
         });
     }
 }
示例#7
0
        public void FormColumnUI_Boolean()
        {
            var col = new Column("MyTest", DataType.Boolean)
            {
                True = "YO", False = "NOPE"
            };

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(frm);
            }
        }
示例#8
0
        public void FormColumnUI()
        {
            var csvFile = new CsvFile(UnitTestInitializeCsv.GetTestPath("BasicCSV.txt"));
            var col     = new Column("ExamDate", DataType.DateTime);

            csvFile.ColumnCollection.AddIfNew(col);

            using (var frm = new FormColumnUI(col, false, csvFile, new FillGuessSettings(), false, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(frm);
            }
        }
示例#9
0
        public void FormColumnUI_TextPart()
        {
            var col = new Column("MyTest", DataType.TextPart)
            {
                PartSplitter = ":", Part = 2, PartToEnd = true
            };

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(frm, .1, f => f.SetPartLabels(":", "2", true));
            }
        }
示例#10
0
        public void FormColumnUI_Numeric()
        {
            var col = new Column("MyTest", DataType.Numeric)
            {
                DecimalSeparator = ".", GroupSeparator = ",", NumberFormat = "0.00"
            };

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(frm, .1, f => f.UpdateNumericLabel(".", "00000", ""));
            }
        }
示例#11
0
        public void FormColumnUIGetColumnHeader2()
        {
            var csvFile = new CsvFile {
                ID = "Csv", FileName = UnitTestInitializeCsv.GetTestPath("BasicCSV.txt")
            };
            var col = new Column("Score", DataType.Double);

            csvFile.ColumnCollection.AddIfNew(col);

            using (var form = new FormColumnUI(col, false, csvFile, new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(form);
            }
        }
示例#12
0
        public void TextDisplay()
        {
            Extensions.RunSTAThread(() =>
            {
                using (var tm = new TimedMessage())
                {
                    tm.Message = "Found values\rLine2\nDMS_Test_RN_Mat\tDMS_Test_RN_Mat\tDMS_Test_RN_Mat\tDMS_Test_RN_Mat\n" +
                                 "DMS_Test_RN_Mat\tDMS_Test_RN_Mat\tDMS_Test_RN_Mat\tDMS_Test_RN_Mat\n\nNote: Text has been cut off after 15 characters";

                    tm.Size = new Size(600, 450);
                    UnitTestWinFormHelper.ShowFormAndClose(tm, 2);
                }
            });
        }
示例#13
0
        public void FormColumnUIGetColumnHeaderAsync()
        {
            var csvFile = new CsvFile(UnitTestInitializeCsv.GetTestPath("BasicCSV.txt"))
            {
                ID = "Csv"
            };

            csvFile.ColumnCollection.AddIfNew(new Column("ID", DataType.Integer));
            csvFile.ColumnCollection.AddIfNew(new Column("ExamDate", DataType.DateTime));
            csvFile.ColumnCollection.AddIfNew(new Column("Score", DataType.Double));

            using (var form = new FormColumnUI(csvFile.ColumnCollection.Get("ExamDate"), false, csvFile,
                                               new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
            {
                UnitTestWinFormHelper.ShowFormAndClose(form);
            }
        }
示例#14
0
        public void FormColumnUI_DateTime()
        {
            var col = new Column("MyTest", DataType.DateTime)
            {
                DateFormat = "dd/MM/yyyy", DateSeparator = ".", TimeSeparator = ":"
            };

            var df = new ValueFormatMutable()
            {
                DataType = DataType.DateTime, DateFormat = "dd/MMM/yyy", DateSeparator = "-", TimeSeparator = "#"
            };

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
                UnitTestWinFormHelper.ShowFormAndClose(frm, .1, f => f.UpdateDateLabel(df, true, "HH:mm", "[UTC]"));

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
                UnitTestWinFormHelper.ShowFormAndClose(frm, .1, f => f.UpdateDateLabel(df, false, "HH:mm:ss", "OtherColumn"));

            using (var frm = new FormColumnUI(col, false, new CsvFile(), new FillGuessSettings(), true, UnitTestInitializeWin.HTMLStyle))
                UnitTestWinFormHelper.ShowFormAndClose(frm, .1, f => f.AddDateFormat("dd MMM yy HH:mm tt"));
        }