Example #1
0
 public Arrange()
 {
     InitializeComponent();
     control           = new clsControl();
     control.DrawGame += Control_DrawGame;
     widthRate         = panel3D1.Width / Size.Width;
 }
 public LooseWindowViewModel(clsControl _objGC, clsQuestion _qtnTmp)
 {
     objGC            = _objGC;
     qtnTmp           = _qtnTmp;
     blnNotOpenMain   = false;
     lblQuestion      = "What was the animal you \n thought about?";
     blnAnimalThought = false;
 }
Example #3
0
        public void SawIfTheLastQuestionInRootIsMonkey()
        {
            newControl = new clsControl();

            string expected = "Monkey";

            clsQuestion result = newControl.GetQuestionByIndex(newControl.lstRootQuestion.Count - 1);

            Assert.AreEqual(result.AnimalName, expected, "The questions are no Equals");
        }
Example #4
0
        public void GetQuestionByIndexTest()
        {
            newControl = new clsControl();

            string expected = "Live in water";

            clsQuestion result = newControl.GetQuestionByIndex(0);

            Assert.AreEqual(result.Characteristic, expected, "The questions are no Equals");
        }
 public QuestionWindowViewModel(clsControl _objGC)
 {
     objGC                    = _objGC;
     blnNotOpenMain           = false;
     strMessageCharacteristic = "Does the animal that you thought about \n {0}?";
     strMessageAnimal         = "Is the animal that you thought \n about a {0}?";
     intListIndex             = 0;
     qtnTmpQuestion           = objGC.GetQuestionByIndex(intListIndex);
     blnEnd                   = false;
     lblQuestion              = string.Format(strMessageCharacteristic, qtnTmpQuestion.Characteristic);
 }
Example #6
0
 private void Canvas3D_DrawGame()
 {
     if (frame != null)
     {
         frame.Draw();
     }
     if (control == null)
     {
         control = new clsControl();
         return;
     }
     control.Draw();//添加Kinect
 }
Example #7
0
        public void SetQuestionInRoot()
        {
            clsQuestion newQuestion = new clsQuestion("Touro", "Tem Chifre", false);

            newControl = new clsControl();

            newControl.PlaceQuestionInRoot(newQuestion);

            string expected = "Monkey";

            clsQuestion result = newControl.GetQuestionByIndex(newControl.lstRootQuestion.Count - 1);

            Assert.AreEqual(result.AnimalName, expected, "The questions are no Equals");

            expected = "Touro";
            result   = newControl.GetQuestionByIndex(newControl.lstRootQuestion.Count - 2);

            Assert.AreEqual(result.AnimalName, expected, "The questions are no Equals");
        }
Example #8
0
        private void populateCollection()
        {
            clearClassCollection();
            foreach (Grid g in listViewDesign.Items)
            {
                control = new clsControl();
                switch (g.Name)
                {
                case "TextBlock":
                    textBlockClass = (clsTextblock)g.DataContext;
                    textBlockCollection.addTextblock(textBlockClass);
                    control.id   = textBlockClass.propId;
                    control.type = textBlockClass.propType;
                    break;

                case "Image":
                    imageClass = (clsImage)g.DataContext;
                    imageCollection.addImage(imageClass);
                    control.id   = imageClass.propId;
                    control.type = imageClass.propType;
                    break;

                case "Button":
                    buttonClass = (clsButton)g.DataContext;
                    buttonCollection.addButton(buttonClass);
                    control.id   = buttonClass.propId;
                    control.type = buttonClass.propType;
                    break;

                case "TextBox":
                    textBoxClass = (clsTextBox)g.DataContext;
                    textBoxCollection.addTextBox(textBoxClass);
                    control.id   = textBoxClass.propId;
                    control.type = textBoxClass.propType;
                    break;

                case "ComboBox":
                    comboboxClass = (clsComboBox)g.DataContext;
                    comboboxCollection.addComboBox(comboboxClass);
                    control.id   = comboboxClass.propId;
                    control.type = comboboxClass.propType;
                    break;

                case "DatePicker":
                    datePickerClass = (clsDatePicker)g.DataContext;
                    datePickerCollection.addDatePicker(datePickerClass);
                    control.id   = datePickerClass.propId;
                    control.type = datePickerClass.propType;
                    break;
                }
                controlCollection.addControl(control.id, control.type);
            }
            xmlInteractionClass = new clsXmlInteraction(templateId,
                                                        listViewDesignBgClass,
                                                        controlCollection,
                                                        textBlockCollection,
                                                        imageCollection,
                                                        buttonCollection,
                                                        textBoxCollection,
                                                        comboboxCollection,
                                                        datePickerCollection);
        }
 public MainWindowViewModel()
 {
     objGC = new clsControl();
 }