public void ChangeCodeFile(string fileName, Action <CodeFile> action, WarningLevel showWarning = WarningLevel.Error) { fileName = fileName.Replace("Southwind", ApplicationName); if (!File.Exists(this.AbsolutePath(fileName))) { if (showWarning != WarningLevel.None) { if (HasWarnings != WarningLevel.Error) { HasWarnings = showWarning; } SafeConsole.WriteLineColor(showWarning == WarningLevel.Error ? ConsoleColor.Red : ConsoleColor.Yellow, showWarning.ToString().ToUpper() + " file " + fileName + " not found"); } } else { var codeFile = new CodeFile(fileName, this) { WarningLevel = showWarning }; action(codeFile); codeFile.SafeIfNecessary(); } }
protected override string GenerateResponseFileCommands() { CompilerCommandLineArguments args = new CompilerCommandLineArguments(); args.AppendSwitchIfTrue("-noconfig", noConfig); if (IsWarningLevelSet) { args.AppendSwitch("-warn:", WarningLevel.ToString()); } args.AppendFileNameIfNotNull("-out:", OutputAssembly); args.AppendTarget(TargetType); args.AppendSwitchIfTrue("-debug", EmitDebugInformation); args.AppendSwitchIfTrue("-optimize", Optimize); args.AppendSwitchIfTrue("-nologo", NoLogo); args.AppendSwitchIfTrue("-unsafe", AllowUnsafeBlocks); args.AppendSwitchIfTrue("-nostdlib", NoStandardLib); args.AppendSwitchIfTrue("-checked", checkForOverflowUnderflow); args.AppendSwitchIfTrue("-delaysign", delaySign); args.AppendSwitchIfNotNull("-langversion:", langVersion); args.AppendSwitchIfNotNull("-keycontainer:", keyContainer); args.AppendSwitchIfNotNull("-keyfile:", keyFile); args.AppendSwitchIfNotNull("-define:", DefineConstants); args.AppendSwitchIfTrue("-warnaserror", TreatWarningsAsErrors); args.AppendSwitchIfNotNull("-nowarn:", DisabledWarnings); args.AppendSwitchIfNotNull("-main:", MainEntryPoint); args.AppendFileNameIfNotNull("-doc:", documentationFile); args.AppendSwitchIfNotNull("-lib:", AdditionalLibPaths, ","); args.AppendReferencesIfNotNull(References); args.AppendItemsIfNotNull("-resource:", Resources); args.AppendFileNameIfNotNull("-win32res:", win32Resource); args.AppendFileNameIfNotNull("-win32icon:", win32Icon); args.AppendFileNamesIfNotNull(Sources, " "); return(args.ToString()); }
protected override string GenerateResponseFileCommands() { CompilerCommandLineArguments args = new CompilerCommandLineArguments(); args.AppendFileNameIfNotNull("-out:", OutputAssembly); if (IsWarningLevelSet) { args.AppendSwitch("-wlevel:", WarningLevel.ToString()); } args.AppendTarget(TargetType); args.AppendSwitchIfTrue("-debug", EmitDebugInformation); args.AppendLowerCaseSwitchIfNotNull("-debug:", DebugType); args.AppendSwitchIfTrue("-nologo", NoLogo); args.AppendSwitchIfTrue("-nowarn", noWarnings); args.AppendSwitchIfTrue("-unsafe", AllowUnsafeBlocks); args.AppendSwitchIfTrue("-nostdlib", NoStandardLib); args.AppendSwitchIfNotNull("-define:", DefineConstants); args.AppendSwitchIfNotNull("-main:", MainEntryPoint); args.AppendSwitchIfNotNull("-lib:", AdditionalLibPaths, ","); args.AppendSwitchIfNotNull("-ignorewarn:", DisabledWarnings); args.AppendSwitchIfTrue("-optionstrict", OptionStrict); args.AppendSwitchIfTrue("-optionexplicit", OptionExplicit); args.AppendSwitchIfTrue("-warnaserror", TreatWarningsAsErrors); args.AppendSwitchIfTrue("-removeintchecks", removeIntegerChecks); args.AppendSwitchIfNotNull("-rootnamespace:", rootNamespace); args.AppendItemsIfNotNull("-imports:", Imports); args.AppendReferencesIfNotNull(References); args.AppendItemsIfNotNull("-resource:", Resources); args.AppendFileNamesIfNotNull(Sources, " "); return(args.ToString()); }
private void UsageWarning(Pawn temp) { float sanityLevel = Cthulhu.Utility.CurrentSanityLoss(temp); if (storedPawn != temp) { storedPawn = temp; warningLevel = WarningLevel.None; } SetWarningLevel(sanityLevel); if (!StartedUse) { StartedUse = true; string stringToTranslate = "OccultCenterWarning" + warningLevel.ToString(); if (stringToTranslate == "OccultCenterWarningNone") { return; } Messages.Message(stringToTranslate.Translate( InteractingPawn.Name.ToStringShort, InteractingPawn.gender.GetPronoun(), InteractingPawn.gender.GetObjective(), InteractingPawn.gender.GetPossessive() ), MessageTypeDefOf.NeutralEvent); } }
public static void InvokeGlobalMessageForBadWeather(Flight flight, WarningLevel level) { var context = GlobalHost.ConnectionManager.GetHubContext <RealTimeUpdateHub>(); context.Clients.All.sendCollisionWarning(JsonConvert.SerializeObject(flight), JsonConvert.SerializeObject(level.ToString())); }
public void RaiseWarning(WarningLevel level, string message) { string wrng = level.ToString() + message; if (!myWarnings.Contains(wrng)) { myWarnings.Add(wrng); myMngr.RaiseWarning(level, message, myDT.TableName); } }
public void CreateCodeFile(string fileName, string content, WarningLevel showWarning = WarningLevel.Error) { fileName = fileName.Replace("Southwind", ApplicationName); if (File.Exists(Path.Combine(this.RootFolder, fileName))) { if (showWarning != WarningLevel.None) { if (HasWarnings != WarningLevel.Error) { HasWarnings = showWarning; } SafeConsole.WriteLineColor(showWarning == WarningLevel.Error ? ConsoleColor.Red : ConsoleColor.Yellow, showWarning.ToString().ToUpper() + " file " + fileName + " already exists"); } } else { File.WriteAllText(Path.Combine(this.RootFolder, fileName), content, CodeFile.GetEncoding(fileName, null)); } }
public void CreateCodeFile(string fileName, string content, WarningLevel showWarning = WarningLevel.Error) { fileName = this.AbsolutePath(fileName.Replace("Southwind", ApplicationName)); if (File.Exists(fileName)) { if (showWarning != WarningLevel.None) { if (HasWarnings != WarningLevel.Error) { HasWarnings = showWarning; } SafeConsole.WriteLineColor(showWarning == WarningLevel.Error ? ConsoleColor.Red : ConsoleColor.Yellow, showWarning.ToString().ToUpper() + " file " + fileName + " already exists"); } } else { var dir = Path.GetDirectoryName(fileName) !; Directory.CreateDirectory(dir); File.WriteAllText(fileName, content, CodeFile.GetEncoding(fileName, null)); } }
public void BuildCommandLine() { List <String> args = new List <String>(); try { args.Add("/dialect:" + _prjNode.GetProjectProperty("Dialect")); // Add pseudo references so the Vulcan/VO dialect will be allowed args.Add("/errorendlocation"); args.Add("/r:vulcanrt.dll"); args.Add("/r:vulcanrtfuncs.dll"); if (String.Equals(ConfigCanonicalName.ConfigName, "DEBUG", StringComparison.OrdinalIgnoreCase)) { args.Add("/debug:full"); } var tmp = ""; foreach (var d in DefinedPreprocessorSymbols) { tmp += ";" + d; } if (tmp.Length > 0) { args.Add("/d:" + tmp.Substring(1)); } tmp = _prjNode.GetProjectProperty("DisabledWarnings"); if (tmp?.Length > 0) { tmp = tmp.Replace(",", ";"); args.Add("/warningaserror-:" + tmp); } args.Add("/warn:" + WarningLevel.ToString()); for (int i = 1; i < 16; i++) { var sw = "vo" + i.ToString(); tmp = _prjNode.GetProjectProperty(sw); if (!String.IsNullOrEmpty(tmp)) { args.Add("/" + sw + (tmp.ToLower() == "true" ? "+" : "-")); } } var include = _prjNode.GetProjectProperty("IncludePaths"); if (!String.IsNullOrEmpty(include)) { include = include + ";" + _includedirs; } else { include = _includedirs; } args.Add("/i:" + include); tmp = _prjNode.GetProjectProperty("NoStandardDefs"); if (!String.IsNullOrEmpty(tmp) && tmp.ToLower() == "true") { args.Add("/nostddefs"); } tmp = _prjNode.GetProjectProperty("INS"); if (!String.IsNullOrEmpty(tmp) && tmp.ToLower() == "true") { args.Add("/ins"); } if (this.TreatWarningsAsErrors) { args.Add("/warnaserror"); } } finally { if (args.Count > 0) { var cmdlineargs = xsCmdLineparser.Parse(args.ToArray(), null, null, null); ParseOptions = cmdlineargs.ParseOptions; } else { var cmdlineargs = xsCmdLineparser.Parse(new string[0], null, null, null); ParseOptions = cmdlineargs.ParseOptions; } ParseOptions.ParseLevel = ParseLevel.Parse; } }
protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine) { #if !NET_4_0 //pre-MSBuild 2 targets don't support multi-targeting, so tell compiler to use 2.0 corlib commandLine.AppendSwitch("/sdk:2"); #endif base.AddResponseFileCommands(commandLine); if (AdditionalLibPaths != null && AdditionalLibPaths.Length > 0) { commandLine.AppendSwitchIfNotNull("/lib:", AdditionalLibPaths, ","); } if (Bag ["AllowUnsafeBlocks"] != null) { if (AllowUnsafeBlocks) { commandLine.AppendSwitch("/unsafe+"); } else { commandLine.AppendSwitch("/unsafe-"); } } //baseAddress if (Bag ["CheckForOverflowUnderflow"] != null) { if (CheckForOverflowUnderflow) { commandLine.AppendSwitch("/checked+"); } else { commandLine.AppendSwitch("/checked-"); } } if (!String.IsNullOrEmpty(DefineConstants)) { string [] defines = DefineConstants.Split(new char [] { ';', ' ' }, StringSplitOptions.RemoveEmptyEntries); if (defines.Length > 0) { commandLine.AppendSwitchIfNotNull("/define:", String.Join(";", defines)); } } if (!String.IsNullOrEmpty(DisabledWarnings)) { string [] defines = DisabledWarnings.Split(new char [] { ';', ' ', ',' }, StringSplitOptions.RemoveEmptyEntries); if (defines.Length > 0) { commandLine.AppendSwitchIfNotNull("/nowarn:", defines, ";"); } } commandLine.AppendSwitchIfNotNull("/doc:", DocumentationFile); //errorReport if (GenerateFullPaths) { commandLine.AppendSwitch("/fullpaths"); } commandLine.AppendSwitchIfNotNull("/langversion:", LangVersion); commandLine.AppendSwitchIfNotNull("/main:", MainEntryPoint); //moduleAssemblyName if (NoStandardLib) { commandLine.AppendSwitch("/nostdlib"); } //platform commandLine.AppendSwitchIfNotNull("/platform:", Platform); // if (References != null) { foreach (ITaskItem item in References) { string aliases = item.GetMetadata("Aliases"); if (!string.IsNullOrEmpty(aliases)) { AddAliasesReference(commandLine, aliases, item.ItemSpec); } else { commandLine.AppendSwitchIfNotNull("/reference:", item.ItemSpec); } } } if (ResponseFiles != null) { foreach (ITaskItem item in ResponseFiles) { commandLine.AppendSwitchIfNotNull("@", item.ItemSpec); } } if (Bag ["WarningLevel"] != null) { commandLine.AppendSwitchIfNotNull("/warn:", WarningLevel.ToString()); } commandLine.AppendSwitchIfNotNull("/warnaserror+:", WarningsAsErrors); commandLine.AppendSwitchIfNotNull("/warnaserror-:", WarningsNotAsErrors); if (Win32Resource != null) { commandLine.AppendSwitchIfNotNull("/win32res:", Win32Resource); } }