Пример #1
0
        public override Node VisitSection([NotNull] SectionContext context)
        {
            // If the Section is a Question, process it.
            var questionContext = context.question();

            if (questionContext != null)
            {
                var questionVisitor = new QuestionVisitor();
                return(questionVisitor.VisitQuestion(questionContext));
            }

            // If it isn't a Question it is most likely to be a ConditionalBlock.
            var conditionalContext = context.conditionalBlock();

            if (conditionalContext != null)
            {
                var conditionalBlockVisitor = new ConditionalBlockVisitor();
                return(conditionalBlockVisitor.VisitConditionalBlock(conditionalContext));
            }

            var computedVariableContext = context.computedVariable();

            if (computedVariableContext != null)
            {
                var computedVisitor = new ComputedVariableVisitor();
                return(computedVisitor.VisitComputedVariable(computedVariableContext));
            }

            //If it manages to reach this line; throw an exception, because it should not be possible.
            throw new InvalidOperationException("We don't know how to process this section.");
        }
Пример #2
0
 //Constructor
 public SectionsController(SectionContext context, StudentContext studContext, GradeContext gradeContext, EventContext eventContext)     //<---------------added formal parameter for studentContext injection
 {
     _context      = context;
     _studContext  = studContext;    //<---------------added injection (Lower 3)
     _gradeContext = gradeContext;
     _eventContext = eventContext;
 }
Пример #3
0
        public override QLNode VisitSection(SectionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("Context can't be null");
            }

            var questionContext = context.question();

            if (questionContext != null)
            {
                var questionVisitor = new QuestionVisitor();
                return(questionVisitor.VisitQuestion(questionContext));
            }

            var conditionalContext = context.conditionalBlock();

            if (conditionalContext != null)
            {
                var conditionalBlockVisitor = new ConditionalBlockVisitor();
                return(conditionalBlockVisitor.VisitConditionalBlock(conditionalContext));
            }

            var computedVariableContext = context.computedVariable();

            if (computedVariableContext != null)
            {
                var computedVisitor = new ComputedVariableVisitor();
                return(computedVisitor.VisitComputedVariable(computedVariableContext));
            }

            //If it manages to reach this line; throw an exception, because it should not be possible.
            throw new NotImplementedException("We don't know how to process this section.");
        }
Пример #4
0
 public HomeController(EventContext ec, GradeContext gc, StudentContext sc, SectionContext ssc)
 {
     _context        = ec;
     _gradeContext   = gc;
     _studentContext = sc;
     _sectionContext = ssc;
     grid            = new ClassroomGrid();
 }
Пример #5
0
        public override Node VisitSection([NotNull] SectionContext context)
        {
            var section = new SectionNode(context.Start, context.STRING().ToString().Trim('"'));

            foreach (Section_contentsContext section_content in context.section_contents())
            {
                if (section_content.question() != null)
                {
                    section.AddChild(Visit(section_content.question()));
                }

                if (section_content.default_style() != null)
                {
                    section.AddChild(Visit(section_content.default_style()));
                }
            }

            return(section);
        }
            public override Section VisitSection(SectionContext context)
            {
                var titleVisitor   = new TextAreasVisitor().Inherit(this);
                var title          = titleVisitor.VisitTitle(context.title());
                var separator      = context.SectionSeparator()[0].GetText();
                var level          = SectionTracker.Track(separator[0]);
                var list           = new List <IElement>();
                var elementVisitor = new ElementVisitor().Inherit(this);
                var element        = context.sectionElement();

                if (element != null)
                {
                    foreach (var item in element)
                    {
                        list.Add(elementVisitor.VisitSectionElement(item));
                    }
                }

                return(new Section(level, title, list, context.overline != null));
            }
Пример #7
0
        public HomeController(SectionContext context)
        {
            _context = context;

            if (_context.Sections.Count() == 0)
            {
                _context.Sections.Add(new SectionItem {
                    SectionName = "GIS",
                    Name        = "Geoinformation Systems",
                    City        = "Tomsk",
                    Location    = "Lenina 2, 404"
                });
                _context.Sections.Add(new SectionItem {
                    SectionName = "CS",
                    Name        = "Computer Science",
                    City        = "Tomsk",
                    Location    = "Lenina 30, 206"
                });
                _context.SaveChanges();
            }
        }
Пример #8
0
        public override QLSNode VisitSection(SectionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("Context can't be null.");
            }

            string id      = Util.RemoveQuotes(context.TEXT().GetText());
            var    styles  = VisitDefaults(context.defaults());
            var    qlsNode = new QLSStructuralNode(Location.FromContext(context), QLSNodeType.Section, id, styles);

            foreach (SectionContext sectionContext in context.section())
            {
                qlsNode.AddNode(VisitSection(sectionContext));
            }

            foreach (QuestionContext questionContext in context.question())
            {
                qlsNode.AddNode(VisitQuestion(questionContext));
            }

            return(qlsNode);
        }
Пример #9
0
        public override void OnRegister(SectionContext context)
        {
            //TODO: Enable host names for non-tenant paths? Maybe? Good idea?
//            context.RegisterHostName("admin.loomportal.com");
        }
Пример #10
0
	public SectionContext section() {
		SectionContext _localctx = new SectionContext(Context, State);
		EnterRule(_localctx, 30, RULE_section);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 135; Match(SECTION);
			State = 136; string_data();
			State = 137; Match(SEPARATOR);
			State = 138; Match(HOME);
			State = 139; Match(T__0);
			State = 140; value();
			State = 141; Match(T__1);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
Пример #11
0
 public override void OnRegister(SectionContext context)
 {
     context.RegisterHostName("tenant2.loomportal.com");
 }
 public ConferenceController(SectionContext context)
 {
     _context = context;
 }
Пример #13
0
 public override void OnRegister(SectionContext context)
 {
 }
Пример #14
0
 public override void OnRegister(SectionContext context)
 {
     context.AddPrimaryRoute("UserAndRole", "/users/{action,[AddUser]}/{role}/", "RouteTest");
     context.AddPrimaryRoute("OneToken", "/users/{action,[GetUser]}/{userId}/", "RouteTest");
     context.AddPrimaryRoute("AddMunster", "/users/{action,[AddMunster]}/{userId}/{munsterName}", "RouteTest");
 }