public void Read(GenericStructure gs) { ID = gs.PropertyInteger("ID"); Name = gs["Name"]; Specification = gs["Specification"]; Engine = (Engine)Enum.Parse(typeof(Engine), gs["EngineID"]); DontRedirectOutput = gs.PropertyBoolean("DontRedirectOutput"); Path = gs["Path"]; Bsp = gs["Bsp"]; Csg = gs["Csg"]; Vis = gs["Vis"]; Rad = gs["Rad"]; IncludePathInEnvironment = gs.PropertyBoolean("IncludePathInEnvironment", true); WorkingDirectory = gs.PropertyEnum("WorkingDirectory", CompileWorkingDirectory.TemporaryDirectory); AfterCopyBsp = gs.PropertyBoolean("AfterCopyBsp"); AfterRunGame = gs.PropertyBoolean("AfterRunGame"); AfterAskBeforeRun = gs.PropertyBoolean("AfterAskBeforeRun"); CopyBsp = gs.PropertyBoolean("CopyBsp"); CopyRes = gs.PropertyBoolean("CopyRes"); CopyLin = gs.PropertyBoolean("CopyLin"); CopyMap = gs.PropertyBoolean("CopyMap"); CopyPts = gs.PropertyBoolean("CopyPts"); CopyLog = gs.PropertyBoolean("CopyLog"); CopyErr = gs.PropertyBoolean("CopyErr"); foreach (var prof in gs.GetChildren("Profile")) { var bp = new BuildProfile(); bp.Read(prof); Profiles.Add(bp); } }
public static CompileParameter Parse(GenericStructure gs) { var param = new CompileParameter { Name = gs["Name"] ?? "", Flag = gs["Flag"] ?? "", Description = gs["Description"] ?? "", Enabled = gs.PropertyBoolean("Enabled"), Value = gs["Value"] ?? "", Type = gs.PropertyEnum("Type", CompileParameterType.Checkbox), Min = gs.PropertyDecimal("Min", Decimal.MinValue), Max = gs.PropertyDecimal("Max", Decimal.MaxValue), Precision = gs.PropertyInteger("Precision", 1), Options = (gs["Options"] ?? "").Split(',').ToList(), OptionValues = (gs["OptionValues"] ?? "").Split(',').ToList(), Filter = gs["Filter"] ?? "" }; return(param); }