Ejemplo n.º 1
0
 private void radioButtonSameDir_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonSameDir.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.SameDirAsFont;
     }
 }
Ejemplo n.º 2
0
 private void radioButtonFixedDir_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonFixedDir.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.FixedDir;
     }
 }
Ejemplo n.º 3
0
 public CmdLineInterface(ValidatorParameters vp,
                         string [] sFilenames,
                         ReportFileDestination rfd,
                         bool bOpenReportFiles,
                         string sReportFixedDir)
 {
     m_vp     = vp;
     m_sFiles = sFilenames;
     m_ReportFileDestination = rfd;
     m_bOpenReportFiles      = bOpenReportFiles;
     m_sReportFixedDir       = sReportFixedDir;
 }
Ejemplo n.º 4
0
 public CmdLineInterface( ValidatorParameters vp, 
                          string [] sFilenames, 
                          ReportFileDestination rfd, 
                          bool bOpenReportFiles, 
                          string sReportFixedDir,
                          bool verbose)
 {
     m_vp = vp;
     m_sFiles = sFilenames;
     m_ReportFileDestination = rfd;
     m_bOpenReportFiles = bOpenReportFiles;
     m_sReportFixedDir = sReportFixedDir;
     m_verbose = verbose;
 }
Ejemplo n.º 5
0
 private void radioButtonTempFiles_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonTempFiles.Checked)
     {
         m_ReportFileDestination       = ReportFileDestination.TempFiles;
         checkBoxOpenReport.CheckState = CheckState.Checked;
         m_bOpenReportFile             = checkBoxOpenReport.Checked;
         checkBoxOpenReport.Enabled    = false;
     }
     else
     {
         checkBoxOpenReport.Enabled = true;
     }
 }
Ejemplo n.º 6
0
 public CmdLineInterface(ValidatorParameters vp,
                         string [] sFilenames,
                         ReportFileDestination rfd,
                         bool bOpenReportFiles,
                         string sReportFixedDir,
                         bool verbose,
                         bool report2stdout)
 {
     m_vp     = vp;
     m_sFiles = sFilenames;
     m_ReportFileDestination = rfd;
     m_bOpenReportFiles      = bOpenReportFiles;
     m_sReportFixedDir       = sReportFixedDir;
     m_verbose       = verbose;
     m_report2stdout = report2stdout;
 }
 private void radioButtonTempFiles_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonTempFiles.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.TempFiles;
         if (Type.GetType("Mono.Runtime") != null)
         {
             m_ReportFileDestination = ReportFileDestination.UserDesktop;
         }
         checkBoxOpenReport.CheckState = CheckState.Checked;
         m_bOpenReportFile             = checkBoxOpenReport.Checked;
         checkBoxOpenReport.Enabled    = false;
     }
     else
     {
         checkBoxOpenReport.Enabled = true;
     }
 }
Ejemplo n.º 8
0
        public Progress( Form1 formParent, 
                         Validator v, 
                         string [] sFilenames, 
                         ReportFileDestination rfd, 
                         bool bOpenReportFiles, 
                         string sReportFixedDir )
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            m_Validator = v;
            m_sFiles = sFilenames;
            m_formParent = formParent;
            m_bValidationInProgress = false;
            m_ReportFileDestination = rfd;
            m_bOpenReportFiles = bOpenReportFiles;
            m_sReportFixedDir = sReportFixedDir;
        }
Ejemplo n.º 9
0
        public Progress(Form1 formParent,
                        Validator v,
                        string [] sFilenames,
                        ReportFileDestination rfd,
                        bool bOpenReportFiles,
                        string sReportFixedDir)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            m_Validator             = v;
            m_sFiles                = sFilenames;
            m_formParent            = formParent;
            m_bValidationInProgress = false;
            m_ReportFileDestination = rfd;
            m_bOpenReportFiles      = bOpenReportFiles;
            m_sReportFixedDir       = sReportFixedDir;
        }
Ejemplo n.º 10
0
 private void radioButtonFixedDir_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonFixedDir.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.FixedDir;
     }
 }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            ResMan.SetResProvider(new MyResProvider());

            if (args.Length == 0)
            {
                try
                {
                    FreeConsole();
                }
                catch (Exception e)
                {
                    // FreeConsole() is neither available nor relevant
                    // on non-windows.
                }
                Application.Run(new Form1());
                return;
            }

            bool   err                      = false;
            string reportDir                = null;
            ReportFileDestination rfd       = ReportFileDestination.TempFiles;
            List <string>         sFileList = new List <string>();
            ValidatorParameters   vp        = new ValidatorParameters();

            int i, j;

            for (i = 0; i < args.Length; i++)
            {
                if ("-file" == args[i])
                {
                    j = i + 1;
                    if (j == args.Length)
                    {
                        ErrOut("Argument required for \"" + args[j - 1] + "\"");
                        err = true;
                        break;
                    }

                    for (; j < args.Length; j++)
                    {
                        if (args[j][0] == '-' || args[j][0] == '+')
                        {
                            j--;
                            break;
                        }
                        sFileList.Add(args[j]);
                    }

                    if (j == i)
                    {
                        ErrOut("Argument required for \"" + args[i] + "\"");
                        err = true;
                        break;
                    }
                    i = j;
                }
                else if ("+table" == args[i])
                {
                    j = i + 1;
                    if (j == args.Length)
                    {
                        ErrOut("Argument required for \"" + args[j - 1] + "\"");
                        err = true;
                        break;
                    }

                    for (; j < args.Length; j++)
                    {
                        if (args[j][0] == '-' || args[j][0] == '+')
                        {
                            j--;
                            break;
                        }
                        vp.AddTable(args[j]);
                    }

                    if (j == i)
                    {
                        ErrOut("Argument required for \"" + args[i] + "\"");
                        err = true;
                        break;
                    }

                    i = j;
                }
                else if ("-table" == args[i])
                {
                    j = i + 1;
                    if (j == args.Length)
                    {
                        ErrOut("Argument required for \"" + args[j - 1] + "\"");
                        err = true;
                        break;
                    }

                    for (; j < args.Length; j++)
                    {
                        if (args[j][0] == '-' || args[j][0] == '+')
                        {
                            j--;
                            break;
                        }
                        vp.RemoveTableFromList(args[j]);
                    }

                    if (j == i)
                    {
                        ErrOut("Argument required for \"" + args[i] + "\"");
                        err = true;
                        break;
                    }

                    i = j;
                }
                else if ("-all-tables" == args[i])
                {
                    vp.SetAllTables();
                }
                else if ("-only-tables" == args[i])
                {
                    vp.ClearTables();
                }
                else if ("-report-dir" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        reportDir = args[i];
                        rfd       = ReportFileDestination.FixedDir;
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-report-in-font-dir" == args[i])
                {
                    rfd = ReportFileDestination.SameDirAsFont;
                }
                else
                {
                    ErrOut("Unknown argument: \"" + args[i] + "\"");
                    err = true;
                }
            }
            if (err)
            {
                Usage();
                return;
            }

            //Ready to run
            Validator v = new Validator();

            vp.SetupValidator(v);

            Program p = new Program();

            p.m_ReportFileDestination = rfd;
            p.m_sReportFixedDir       = reportDir;

            Driver drv = new Driver(p);

            drv.RunValidation(v, sFileList.ToArray());
        }
Ejemplo n.º 12
0
        static int Main(string[] args)
        {
            bool   err                      = false;
            bool   verbose                  = true;
            bool   report2stdout            = false;
            string reportDir                = null;
            ReportFileDestination rfd       = ReportFileDestination.UserDesktop;
            List <string>         sFileList = new List <string>();
            ValidatorParameters   vp        = new ValidatorParameters();

            if (args.Length == 0)
            {
                Usage();
                return(0);
            }

            if (args[0].EndsWith(".py"))
            {
                // Not try/catch.
                EmbeddedIronPython.RunScriptWithArgs(args);
                return(0);
            }

            vp.SetRasterTesting();
            for (int i = 0; i < args.Length; i++)
            {
                if ("-file" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        sFileList.Add(args[i]);
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("+table" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        vp.AddTable(args[i]);
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-table" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        int n = vp.RemoveTableFromList(args[i]);
                        if (0 == n)
                        {
                            ErrOut("Table \"" + args[i] + "\" not found");
                            err = true;
                        }
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-all-tables" == args[i] || "+all-tables" == args[i])
                {
                    vp.SetAllTables();
                }
                else if ("-only-tables" == args[i])
                {
                    vp.ClearTables();
                }
                else if ("-quiet" == args[i])
                {
                    verbose = false;
                }
                else if ("-stdout" == args[i] || "-report-stdout" == args[i])
                {
                    verbose       = false;
                    report2stdout = true;
                    rfd           = ReportFileDestination.TempFiles;
                }
                else if ("-test-parms" == args[i])
                {
                    i++;
                    try
                    {
                        vp = (ValidatorParameters)EmbeddedIronPython.RunPythonMethod(args[i], "validation_parameters", "GetValue");
                    }
                    catch (Exception e)
                    {
                        ErrOut("Setting -test-parms failure: " + e.Message);
                        err = true;
                    }
                }
                else if ("+raster-tests" == args[i])
                {
                    // default
                }
                else if ("-no-raster-tests" == args[i])
                {
                    vp.SetNoRasterTesting();
                }
                else if ("-report-dir" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        reportDir = args[i];
                        rfd       = ReportFileDestination.FixedDir;
                        // Try writing to the directory to see if it works.
                        using (FileStream fs = File.Create(
                                   Path.Combine(
                                       reportDir,
                                       Path.GetRandomFileName()
                                       ),
                                   1,                         // bufferSize
                                   FileOptions.DeleteOnClose)
                               )
                        { };
                        // exception should throw & abort on failure
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-report-in-font-dir" == args[i])
                {
                    rfd = ReportFileDestination.SameDirAsFont;
                }
                else if ("-temporary-reports" == args[i])
                {
                    rfd = ReportFileDestination.TempFiles;
                }
                else if ("-version" == args[i])
                {
                    Console.WriteLine("Version: {0}", version);
                    return(0); /* terminates success */
                }
                else
                {
                    ErrOut("Unknown argument: \"" + args[i] + "\"");
                    err = true;
                }
            }
            if (err)
            {
                Usage();
                return(1);
            }

            CmdLineInterface cmd = new
                                   CmdLineInterface(vp, sFileList.ToArray(), rfd, false,
                                                    reportDir, verbose, report2stdout);

            return(cmd.DoIt());
        }
Ejemplo n.º 13
0
 public PersistedData()
 {
     m_sMRUProjects = new String[4];
     m_sMRUReports  = new String[4];
     m_ReportFileDestination = ReportFileDestination.TempFiles;
     m_bOpenReportFile = true;
     m_sReportFixedDir = "";
     m_bFirstTime = true;
 }
Ejemplo n.º 14
0
        static int Main(string[] args)
        {
            bool   err                      = false;
            string reportDir                = null;
            ReportFileDestination rfd       = ReportFileDestination.TempFiles;
            List <string>         sFileList = new List <string>();
            ValidatorParameters   vp        = new ValidatorParameters();

            if (args.Length == 0)
            {
                Usage();
                return(0);
            }

            for (int i = 0; i < args.Length; i++)
            {
                if ("-file" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        sFileList.Add(args[i]);
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("+table" == args[i])
                {
                    if (i < args.Length)
                    {
                        vp.AddTable(args[i]);
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-table" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        int n = vp.RemoveTableFromList(args[i]);
                        if (0 == n)
                        {
                            ErrOut("Table \"" + args[i] + "\" not found");
                            err = true;
                        }
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-all-tables" == args[i])
                {
                    vp.SetAllTables();
                }
                else if ("-only-tables" == args[i])
                {
                    vp.ClearTables();
                }
                else if ("-report-dir" == args[i])
                {
                    i++;
                    if (i < args.Length)
                    {
                        reportDir = args[i];
                        rfd       = ReportFileDestination.FixedDir;
                    }
                    else
                    {
                        ErrOut("Argument required for \"" + args[i - 1] + "\"");
                        err = true;
                    }
                }
                else if ("-report-in-font-dir" == args[i])
                {
                    rfd = ReportFileDestination.SameDirAsFont;
                }
                else
                {
                    ErrOut("Unknown argument: \"" + args[i] + "\"");
                    err = true;
                }
            }
            if (err)
            {
                Usage();
                return(1);
            }

            CmdLineInterface cmd = new
                                   CmdLineInterface(vp, sFileList.ToArray(), rfd, false,
                                                    reportDir);

            return(cmd.DoIt());
        }
Ejemplo n.º 15
0
 private void radioButtonSameDir_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonSameDir.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.SameDirAsFont;
     }
 }
Ejemplo n.º 16
0
 private void radioButtonTempFiles_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonTempFiles.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.TempFiles;
         checkBoxOpenReport.CheckState = CheckState.Checked;
         m_bOpenReportFile = checkBoxOpenReport.Checked;
         checkBoxOpenReport.Enabled = false;
     }
     else
     {
         checkBoxOpenReport.Enabled = true;
     }
 }
 private void radioButtonTempFiles_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonTempFiles.Checked)
     {
         m_ReportFileDestination = ReportFileDestination.TempFiles;
         if ( Type.GetType("Mono.Runtime") != null )
             m_ReportFileDestination = ReportFileDestination.UserDesktop;
         checkBoxOpenReport.CheckState = CheckState.Checked;
         m_bOpenReportFile = checkBoxOpenReport.Checked;
         checkBoxOpenReport.Enabled = false;
     }
     else
     {
         checkBoxOpenReport.Enabled = true;
     }
 }