Пример #1
0
        //static int Main(string[] args)
        static void Main()
        {
            try
            {
                Trace.CurrentTrace.SetLogFile("log.txt", LogOptions.None);

                XmlConfig config = new XmlConfig();
                FormatInfo.SetInvariantCulture();
                Application.CurrentCulture = FormatInfo.CurrentFormat.CurrentCulture;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                RemoteRunSource remoteRunSource = new RemoteRunSource();
                remoteRunSource.RunsourceDllFilename = config.GetExplicit("RunsourceDllFilename");
                remoteRunSource.RunsourceClassName = config.GetExplicit("RunsourceClassName");
                //remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs<bool>(true);
                // attention si CreateRunSourceDomain = true runsource.launch.exe ne peut pas mettre à jour runsource.runsourced32.exe
                remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs<bool>(false);
                RunSourceForm form = new RunSourceForm(remoteRunSource.GetRunSource(), config, GetRunSourceRestartParameters());

                //form.UpdateRunsourceFiles += FormUpdateRunsourceFiles;
                form.SetRestartRunsource += FormSetRestartRunsource;
                Application.Run(form);
                //if (_projectFiles != null)
                SetRunSourceUpdateAndRestartParameters();

                //if (_updateProgram)
                //{
                //    _updateProgram = false;
                //    return 1;
                //}
                //else
                //    return 0;
            }
            catch (Exception ex)
            {
                zerrf.ErrorMessageBox(ex);
                //return 0;
            }
        }
Пример #2
0
        //static int Main(string[] args)
        static void Main()
        {
            try
            {
                Trace.CurrentTrace.SetLogFile("log.txt", LogOptions.None);

                XmlConfig config = new XmlConfig();
                FormatInfo.SetInvariantCulture();
                Application.CurrentCulture = FormatInfo.CurrentFormat.CurrentCulture;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                RemoteRunSource remoteRunSource = new RemoteRunSource();
                remoteRunSource.RunsourceDllFilename = config.GetExplicit("RunsourceDllFilename");
                remoteRunSource.RunsourceClassName   = config.GetExplicit("RunsourceClassName");
                //remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs<bool>(true);
                // attention si CreateRunSourceDomain = true runsource.launch.exe ne peut pas mettre à jour runsource.runsourced32.exe
                remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs <bool>(false);
                RunSourceForm form = new RunSourceForm(remoteRunSource.GetRunSource(), config, GetRunSourceRestartParameters());

                //form.UpdateRunsourceFiles += FormUpdateRunsourceFiles;
                form.SetRestartRunsource += FormSetRestartRunsource;
                Application.Run(form);
                //if (_projectFiles != null)
                SetRunSourceUpdateAndRestartParameters();

                //if (_updateProgram)
                //{
                //    _updateProgram = false;
                //    return 1;
                //}
                //else
                //    return 0;
            }
            catch (Exception ex)
            {
                zerrf.ErrorMessageBox(ex);
                //return 0;
            }
        }
Пример #3
0
        static void Main()
        {
            try
            {
                XmlConfig config = new XmlConfig();

                //Trace.CurrentTrace.SetLogFile("log.txt", LogOptions.None);
                //string path = config.Get("Log").zSetRootDirectory();
                //if (path != null)
                //    _runSource.Trace.SetLogFile(path, LogOptions.IndexedFile);
                //Trace.WriteLine(config.Get("Log").zSetRootDirectory());
                //LogOptions logOptions = config.Get("Log/@LogOptions").zTextDeserialize(LogOptions.None);
                //Trace.WriteLine(logOptions.ToString());
                //Trace.CurrentTrace.SetLogFile(config.Get("Log").zSetRootDirectory(), config.Get("Log/@LogOptions").zTextDeserialize(LogOptions.None));
                //Trace.WriteLine(Trace.CurrentTrace.GetLogFile());

                FormatInfo.SetInvariantCulture();
                Application.CurrentCulture = FormatInfo.CurrentFormat.CurrentCulture;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                RemoteRunSource remoteRunSource = new RemoteRunSource();
                remoteRunSource.RunsourceDllFilename = config.GetExplicit("RunsourceDllFilename");
                remoteRunSource.RunsourceClassName   = config.GetExplicit("RunsourceClassName");
                remoteRunSource.TraceClassName       = config.GetExplicit("TraceClassName");
                //remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs<bool>(true);
                // ATTENTION si CreateRunSourceDomain = true runsource.launch.exe ne peut pas mettre à jour runsource.runsource.exe
                remoteRunSource.CreateRunSourceDomain = config.Get("CreateRunSourceDomain").zTryParseAs <bool>(false);
                IRunSource runSource = remoteRunSource.GetRunSource();
                runSource.AllowMultipleExecution = config.Get("AllowMultipleExecution").zTryParseAs(false);
                // ATTENTION Trace exists in both 'runsource.runsource.exe' and 'runsource.dll'
                // donc il faut utiliser RemoteRunSource.GetTrace()
                ITrace trace = remoteRunSource.GetTrace();
                //trace.SetLogFile(config.Get("Log").zRootPath(zapp.GetAppDirectory()), config.Get("Log/@LogOptions").zTextDeserialize(LogOptions.None));
                // .zRootPath(zapp.GetAppDirectory())
                trace.SetWriter(config.Get("Log"), config.Get("Log/@option").zTextDeserialize(FileOption.None));

                //runSource.GenerateAndExecuteManager.GenerateAssemblyDirectory = config.Get("GenerateAssemblyDirectory", "run").zRootPath(zapp.GetAppDirectory());
                // ATTENTION appeler DeleteGeneratedAssemblies() après SetRunSourceConfig()
                //runSource.DeleteGeneratedAssemblies();
                //RunSourceForm_v1 form = new RunSourceForm_v1(runSource, trace, config, GetRunSourceRestartParameters());
                RunSourceForm form = new RunSourceForm(runSource, trace, config, GetRunSourceRestartParameters());

                //form.UpdateRunsourceFiles += FormUpdateRunsourceFiles;
                form.SetRestartRunsource += FormSetRestartRunsource;
                Application.Run(form);
                //if (_projectFiles != null)
                SetRunSourceRestartParameters();
                //SetRunSourceUpdateParameters();

                //if (_updateProgram)
                //{
                //    _updateProgram = false;
                //    return 1;
                //}
                //else
                //    return 0;
                //Application.Exit();
            }
            catch (Exception ex)
            {
                zerrf.ErrorMessageBox(ex);
                //return 0;
            }
        }