//static int Main(string[] args) static void Main() { try { 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.TraceClassName = config.GetExplicit("TraceClassName"); // 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.SetWriter(config.Get("Log"), config.Get("Log/@option").zTextDeserialize(FileOption.None)); // ATTENTION appeler DeleteGeneratedAssemblies() après SetRunSourceConfig() //RunSourceForm form = new RunSourceForm(runSource, trace, config, GetRunSourceRestartParameters()); RunSourceForm_v3 form = new RunSourceForm_v3(runSource, trace, config, GetRunSourceRestartParameters()); form.SetRestartRunsource += FormSetRestartRunsource; Application.Run(form); SetRunSourceRestartParameters(); } catch (Exception ex) { zerrf.ErrorMessageBox(ex); } }
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; } }