本文整理汇总了C#中ErrorLogger.Error方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorLogger.Error方法的具体用法?C# ErrorLogger.Error怎么用?C# ErrorLogger.Error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorLogger
的用法示例。
在下文中一共展示了ErrorLogger.Error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseWorld
protected static void ParseWorld(WorldCollection worlds, StringDictionary dict, string line, int lineNumber, ErrorLogger errors)
{
try
{
FieldChecker checker = new FieldChecker(dict, errors, lineNumber, line);
World world = new World();
world.Hex = checker.Check("Hex", HEX_REGEX);
world.Name = dict["Name"];
world.UWP = checker.Check("UWP", UWP_REGEX);
world.Remarks = checker.Check(new string[] { "Remarks", "Trade Codes", "Comments" });
world.Importance = checker.Check(new string[] { "{Ix}", "{ Ix }", "Ix" });
world.Economic = checker.Check(new string[] { "(Ex)", "( Ex )", "Ex" });
world.Cultural = checker.Check(new string[] { "[Cx]", "[ Cx ]", "Cx" });
world.Nobility = checker.Check(new string[] { "N", "Nobility" }, NOBILITY_REGEX, CheckOptions.EmptyIfDash);
world.Bases = checker.Check(new string[] { "B", "Bases" }, BASES_REGEX, CheckOptions.EmptyIfDash);
world.Zone = checker.Check(new string[] { "Z", "Zone" }, ZONE_REGEX, CheckOptions.EmptyIfDash);
world.PBG = checker.Check("PBG", PBG_REGEX);
world.Allegiance = checker.Check(new string[] { "A", "Al", "Allegiance" },
// TODO: Allow unofficial sectors to have locally declared allegiances.
a => a.Length != 4 || SecondSurvey.IsKnownT5Allegiance(a));
world.Stellar = checker.Check(new string[] { "Stellar", "Stars", "Stellar Data" }, STARS_REGEX, CheckOptions.Warning);
int w;
if (Int32.TryParse(checker.Check(new string[] { "W", "Worlds" }), NumberStyles.Integer, CultureInfo.InvariantCulture, out w))
world.Worlds = w;
int ru;
if (Int32.TryParse(dict["RU"], NumberStyles.Integer | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out ru))
world.ResourceUnits = ru;
// Cleanup known placeholders
if (world.Name == world.Name.ToUpperInvariant() && world.IsHi)
world.Name = Util.FixCapitalization(world.Name);
if (worlds[world.X, world.Y] != null && errors != null)
errors.Warning("Duplicate World", lineNumber, line);
if (!checker.HadError)
{
worlds[world.X, world.Y] = world;
}
}
catch (Exception e)
{
errors.Error("Parse Error: " + e.Message, lineNumber, line);
//throw new Exception(String.Format("UWP Parse Error in line {0}:\n{1}\n{2}", lineNumber, e.Message, line));
}
}