예제 #1
0
        private void AutoDetectFormat(bool hasHeaders)
        {
            var dialog = new OpenFileDialog();
            dialog.Multiselect = false;
            dialog.Title = "Select a Sample File";
            if (dialog.ShowDialog() == DialogResult.Cancel)
                return;

            var detector = new SmartFormatDetector();
            detector.FileHasHeaders = hasHeaders;
            detector.MaxSampleLines = 100;
            var formats = detector.DetectFileFormat(dialog.FileName);

            if (formats.Length == 0)
                return;

            ClassBuilderToWizard(formats[0].ClassBuilder);

            var frm = new frmDataPreview(mLastCode, mWizardInfo.Language);
            frm.HasHeaders = hasHeaders;
            frm.txtInput.Text = File.ReadAllText(dialog.FileName);
            frm.AutoRunTest = true;
            frm.ShowDialog();
            frm.Dispose();
        }
예제 #2
0
 private void cmdTestClass_Click(object sender, EventArgs e)
 {
     using (var frm = new frmDataPreview(mLastCode, mWizardInfo.Language))
     {
         frm.ShowDialog();
         frm.Dispose();
     }
 }
예제 #3
0
 private void cmdTestClass_Click(object sender, EventArgs e)
 {
     frmDataPreview frm = new frmDataPreview(sdClassOut.Text, cboClassLeng.SelectedIndex);
     frm.ShowDialog();
     frm.Dispose();
 }