public void TestShorthandConfiguration() { var root = new ShorthandRoot(File.ReadAllText(@"shorthand.xml")); foreach (var error in root.Errors()) { Console.WriteLine(error); } Assert.AreEqual(0, root.Errors().Count()); Assert.AreEqual(4, root.Signatures.Count); Assert.AreEqual(2, root.Targets.Count); Assert.AreEqual(6, root.Methods.Count); }
protected void LoadShorthand(string cfg) { this.Clear(Events); Shorthand = new ShorthandRoot(cfg, Reader, Parser); if (Shorthand.Warnings().Any()) { foreach (var warning in Shorthand.Warnings()) { Events.Warning(warning); } } if (Shorthand.Errors().Any()) { foreach (var error in Shorthand.Errors()) { Events.Error(error); } return; } Shorthand.InitializeMethodDataLookup(); }
CfgNode Load( INode node, string parent, ISerializer serializer, CfgEvents events, IDictionary<string, IValidator> validators, ShorthandRoot shorthand, Dictionary<string, string> parameters ) { this.Clear(events); Shorthand = shorthand; Validators = validators; Serializer = serializer; LoadProperties(node, parent, parameters); LoadCollections(node, parent, parameters); PreValidate(); ValidateBasedOnAttributes(); ValidateListsBasedOnAttributes(node.Name); Validate(); PostValidate(); return this; }