コード例 #1
0
ファイル: ShorthandTest.cs プロジェクト: modulexcite/Cfg-NET
        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);
        }
コード例 #2
0
ファイル: CfgNode.cs プロジェクト: modulexcite/Cfg-NET
        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();
        }