public void Save(XmlWriter writer) { writer.WriteStartDocument(true); writer.WriteStartElement("kei-gui"); writer.WriteAttributeString("config-version", "1.1"); writer.WriteElementString("EnableLogging", EnableLogging.ToString()); writer.WriteElementString("LocalIntranetAddress", LocalIntranetAddress); writer.WriteElementString("LocalKClientPort", LocalKClientPort.ToString()); writer.WriteElementString("LocalTrackerServerPort", LocalTrackerServerPort.ToString()); writer.WriteElementString("ForceBroadcastTime", ForceBroadcastTime.ToString()); writer.WriteElementString("AutoStartAndConnect", AutoStartAndConnect.ToString()); writer.WriteElementString("IsPointInsertion", IsPointInsertion.ToString()); writer.WriteElementString("UseUPnP", UsePortMapping.ToString()); writer.WriteStartElement("TargetEndPoints"); foreach (var item in TargetEndPoints) { writer.WriteElementString("EndPoint", item); } writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); }
protected override string GenerateResponseFileCommands() { var args = new Dictionary <string, string> { ["KernelPkg"] = KernelPkg, ["EnableDebug"] = DebugEnabled.ToString(), ["EnableStackCorruptionDetection"] = StackCorruptionDetectionEnabled.ToString(), ["StackCorruptionDetectionLevel"] = StackCorruptionDetectionLevel, ["DebugMode"] = DebugMode, ["TraceAssemblies"] = TraceAssemblies, ["DebugCom"] = DebugCom.ToString(), ["TargetAssembly"] = Path.GetFullPath(TargetAssembly), ["OutputFilename"] = Path.GetFullPath(OutputFilename), ["EnableLogging"] = EnableLogging.ToString(), ["EmitDebugSymbols"] = EmitDebugSymbols.ToString(), ["IgnoreDebugStubAttribute"] = IgnoreDebugStubAttribute.ToString(), }.ToList(); foreach (var reference in References) { args.Add(new KeyValuePair <string, string>("References", reference.ItemSpec)); } foreach (var plugsReference in PlugsReferences) { args.Add(new KeyValuePair <string, string>("PlugsReferences", plugsReference.ItemSpec)); } return(String.Join(Environment.NewLine, args.Select(a => $"{a.Key}:{a.Value}"))); }
protected override string GenerateCommandLineCommands() { Dictionary <string, string> args = new Dictionary <string, string> { { "KernelPkg", KernelPkg }, { "EnableDebug", DebugEnabled.ToString() }, { "EnableStackCorruptionDetection", StackCorruptionDetectionEnabled.ToString() }, { "StackCorruptionDetectionLevel", StackCorruptionDetectionLevel }, { "DebugMode", DebugMode }, { "TraceAssemblies", TraceAssemblies }, { "DebugCom", DebugCom.ToString() }, { "OutputFilename", Path.GetFullPath(OutputFilename) }, { "EnableLogging", EnableLogging.ToString() }, { "EmitDebugSymbols", EmitDebugSymbols.ToString() }, { "IgnoreDebugStubAttribute", IgnoreDebugStubAttribute.ToString() } }; List <string> refs = (from reference in References where reference.MetadataNames.OfType <string>().Contains("FullPath") select reference.GetMetadata("FullPath") into xFile select Convert.ToString(xFile)).ToList(); string Arguments = args.Aggregate("", (current, arg) => current + "\"" + arg.Key + ":" + arg.Value + "\" "); Arguments = refs.Aggregate(Arguments, (current, Ref) => current + "\"References:" + Ref + "\" "); Arguments = AssemblySearchDirs.Split(';').Aggregate(Arguments, (current, Dir) => current + "\"AssemblySearchDirs:" + Dir + "\" "); // replace \" by \\" Arguments = Arguments.Replace("\\\"", "\\\\\""); Log.LogMessage(MessageImportance.High, $"Invoking IL2CPU.exe {Arguments}"); return(Arguments); }