Пример #1
0
 public void XamlReader2()
 {
     using (var runner = new ShellRunner())
     {
         runner.LoadFile("xamltest2.xaml");
     }
 }
Пример #2
0
 protected ShellRunner CreateRunner()
 {
     var runner = new ShellRunner();
     runner.Context.SetDefaultConnection("sqlserver://" + ConfigurationManager.ConnectionStrings["Database"].ConnectionString + ";Initial Catalog=" +
                                         ConfigurationManager.AppSettings["Database"]);
     return runner;
 }
Пример #3
0
 public void CsvExport()
 {
     using (var runner = new ShellRunner())
     {
         runner.LoadFile("csvexport.xaml");
         runner.Run();
     }
 }
Пример #4
0
 public void CsvImport()
 {
     using (var runner = new ShellRunner())
     {
         runner.LoadFile("csvimport.xaml");
         runner.Run();
         Assert.IsTrue(TestUtility.FileCompare("Album.csv", "Album2.csv"));
     }
 }
Пример #5
0
        private static int Main(string[] args)
        {
            XmlConfigurator.Configure();

            var runner = new ShellRunner();
            try
            {
                runner.LoadFile(args[0]);
                for (int i = 1; i < args.Length; i++)
                {
                    if (args[i].StartsWith("--"))
                    {
                        string name = args[i].Substring(2);
                        i++;
                        if (i >= args.Length) break;
                        runner.Context.SetVariable(name, args[i]);
                    }
                    else if (args[i] == "/sqlconn")
                    {
                        i++;
                        if (i >= args.Length) break;

                        string sqlconn = args[i];
                        runner.Context.SetDefaultConnection("sqlserver://" + sqlconn);
                    }
                }
            }
            catch (Exception err)
            {
                _log.Error("DBSH-00146 Error loading XAML", err);
                return 1;
            }

            try
            {
                runner.Run();
            }
            catch (Exception err)
            {
                _log.Error("DBSH-00147 Error running process", err);
                return 2;
            }
            return 0;
        }