コード例 #1
0
        public StudentFormController(Student.QuestionForm mainform)
        {
            this.mainForm = mainform;
            view = mainForm.getView();

            //Connect (this) client to the session
            client = SignalRClient.GetInstance();
            client.ConnectionStatusChanged += Client_connectionStatusChanged;
            client.Connect();

            //Adds an event to the QuestionAdded function which is called when a new question is added by the teacher.
            QuestionFactory questionFactory = new QuestionFactory();
            questionFactory.QuestionAdded += Factory_questionAdded;

            //Adds an event to the QuestionListContinue function which is called when the teacher presses "Next" button for the next question.
            QuestionListFactory listFactory = new QuestionListFactory();
            listFactory.QuestionListContinue += LIFactory_continue;
            listFactory.QuestionListStarted += LIFactory_startList;
            listFactory.QuestionListStopped += LIFactory_stopped;

            //Adds an event to the PredefinedAnswerAdded function which is called for each PredefinedAnswer in the next question.
            PredefinedAnswerFactory PAFactory = new PredefinedAnswerFactory();
            PAFactory.PredefinedAnswerAdded += PAFactory_predefinedAnswerAdded;

            //Adds event, when an openquestion is added
            OpenQuestionFactory OpenQuestionFactory = new OpenQuestionFactory();
            OpenQuestionFactory.OpenQuestionAdded += openQuestionAdded;
        }
コード例 #2
0
        public static SignalRClient GetInstance()
        {
            if (INSTANCE == null)
            {
                INSTANCE = new SignalRClient();
            }

            return INSTANCE;
        }