Esempio n. 1
0
        public TestEditorTag(FixtureLibrary library) : base("div")
        {
            AddClass("main");
            Add("h2").AddClass(HtmlClasses.TEST_NAME);
            Id("testEditor");

            AddClass(HtmlClasses.TEST_EDITOR);

            _container = Add("div").AddClasses("container", HtmlClasses.SECTION, "test-editor");

            FixtureGraph fixture = library.BuildTopLevelGraph();

            HtmlTag holder = new HolderTag(fixture).AddClass("top-level-holder");

            holder.Children.Last().Render(false);

            Container
            .MetaData(GrammarConstants.LEAF_NAME, GrammarConstants.TEST)
            .MetaData(GrammarConstants.FIXTURE, GrammarConstants.TEST)
            .MetaData(GrammarConstants.SELECTION_MODE, SelectionMode.OneOrMore.ToString())
            .Append(holder)
            .Append(new HtmlTag("hr"));


            Container.ActionLink(fixture.Policies.AddGrammarText, GrammarConstants.ADD_SECTION_ACTIVATOR);
            Container.Append(new GrammarSelector(fixture).Build());
        }
Esempio n. 2
0
        public void SetUp()
        {
            library = new FixtureLibrary();
            library.FixtureFor("Math").Policies.IsPrivate        = false;
            library.FixtureFor("Algebra").Policies.IsPrivate     = false;
            library.FixtureFor("MathDetails").Policies.IsPrivate = true;
            library.FixtureFor("Calculus").Policies.IsPrivate    = false;

            topFixture = library.BuildTopLevelGraph();

            mathSection = topFixture.GrammarFor("Math").ShouldBeOfType <EmbeddedSection>();
        }
Esempio n. 3
0
        public HtmlTag Build()
        {
            _top = new DivTag(GrammarConstants.FIXTURE_SELECTOR).Hide();

            FixtureGraph topFixture     = _library.BuildTopLevelGraph();
            var          topFixtureNode = writeFixture(topFixture);

            topFixtureNode.Children.Each(x => x.AddClass("top-node"));

            _library.ActiveFixtures.Each(f => writeFixture(f));

            return(_top);
        }