Пример #1
0
        public override void ViewDidLoad()
        {
            // Hide the toolbar
            base.ViewDidLoad();
            NavigationController.SetToolbarHidden(true, true);

            // Error state
            if (_questions.Count < 1)
            {
                Logger.Warn("AnswerQuestionsController was pushed with zero questions for {0}", _category.Name);
                NavigationController.PopViewControllerAnimated(true);
            }

            // Flashcard bg image
            _bgImage           = UIImage.FromFile("Assets/Images/flashcardbg.jpg");
            _bgImageView       = new UIImageView(_bgImage);
            _bgImageView.Frame = new RectangleF(0, 0, 320, 480);
            View.AddSubview(_bgImageView);

            // The question label
            _labelQuestion                 = new UILabel();
            _labelQuestion.Text            = "";
            _labelQuestion.Font            = UIFont.SystemFontOfSize(24f);
            _labelQuestion.TextColor       = UIColor.Black;
            _labelQuestion.Frame           = new RectangleF(15, 15, 290, 50);
            _labelQuestion.BackgroundColor = UIColor.Clear;
            _labelQuestion.Lines           = 2;
            View.AddSubview(_labelQuestion);

            // Show button, triggers the answer being visible
            _buttonShow      = new UnderlineButton();
            _buttonShow.Font = UIFont.SystemFontOfSize(16f);
            _buttonShow.SetTitle("Reveal answer...", UIControlState.Normal);
            _buttonShow.SetTitleColor(UIColor.Black, UIControlState.Normal);
            _buttonShow.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            _buttonShow.Frame      = new RectangleF(15, 80, 120, 25);
            _buttonShow.TouchDown += new EventHandler(ShowAnswer);
            View.AddSubview(_buttonShow);

            // The answer label
            _labelAnswer                 = new UILabel();
            _labelAnswer.Text            = "";
            _labelAnswer.Font            = UIFont.SystemFontOfSize(24f);
            _labelAnswer.TextColor       = UIColor.Gray;
            _labelAnswer.Frame           = new RectangleF(15, 140, 290, 180);
            _labelAnswer.BackgroundColor = UIColor.Clear;
            _labelAnswer.Lines           = 7;
            View.AddSubview(_labelAnswer);

            // The 6 score buttons
            AddScoreButtons();

            // The first question, display it in the labels
            _currentQuestion = _questions[_questionIndex];
            BindQuestion(_currentQuestion);
        }
        public CustomServerCell(NSString cellId)
            : base(UITableViewCellStyle.Default, cellId)
        {
            SelectionStyle = UITableViewCellSelectionStyle.Gray;

            hostLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 10f),
                BackgroundColor = UIColor.Clear
            };

            portLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 10f),
                BackgroundColor = UIColor.Clear
            };

            descLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 10f),
                BackgroundColor = UIColor.Clear
            };

            countryLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 8f),
                BackgroundColor = UIColor.Clear
            };

            stateLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 8f),
                BackgroundColor = UIColor.Clear
            };

            countyLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 8f),
                BackgroundColor = UIColor.Clear
            };

            stateImageView = new UIImageView ();

            alertLabel = new UILabel () {
                Font = UIFont.FromName("AmericanTypewriter", 10f),
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.Red,
                Text = "Remote Alerts"
            };

            btnReg = new UnderlineButton () {
                Font = UIFont.FromName("AmericanTypewriter", 10f)
            };
            btnReg.SetTitle ("Register", UIControlState.Normal);
            btnReg.SetTitleColor (UIColor.Red, UIControlState.Normal);
            btnReg.TouchUpInside += btnRegTouchUpInside_Event;

            btnUnreg = new UnderlineButton () {
                Font = UIFont.FromName("AmericanTypewriter", 10f),
            };
            btnUnreg.SetTitle ("UnRegister", UIControlState.Normal);
            btnUnreg.SetTitleColor (UIColor.Red, UIControlState.Normal);
            btnUnreg.TouchUpInside += btnUnregTouchUpInside_Event;

            ContentView.Add (stateImageView);
            ContentView.Add (hostLabel);
            ContentView.Add (portLabel);
            ContentView.Add (descLabel);
            ContentView.Add (countryLabel);
            ContentView.Add (stateLabel);
            ContentView.Add (countyLabel);

            #if PLUS_VERSION
            ContentView.Add (alertLabel);
            ContentView.Add (btnReg);
            ContentView.Add (btnUnreg);
            #endif
        }
        public override void ViewDidLoad()
        {
            // Hide the toolbar
            base.ViewDidLoad();
            NavigationController.SetToolbarHidden(true,true);

            // Error state
            if (_questions.Count < 1)
            {
                Logger.Warn("AnswerQuestionsController was pushed with zero questions for {0}", _category.Name);
                NavigationController.PopViewControllerAnimated(true);
            }

            // Flashcard bg image
            _bgImage = UIImage.FromFile("Assets/Images/flashcardbg.jpg");
            _bgImageView = new UIImageView(_bgImage);
            _bgImageView.Frame = new RectangleF(0,0,320,480);
            View.AddSubview(_bgImageView);

            // The question label
            _labelQuestion = new UILabel();
            _labelQuestion.Text = "";
            _labelQuestion.Font = UIFont.SystemFontOfSize(24f);
            _labelQuestion.TextColor = UIColor.Black;
            _labelQuestion.Frame = new RectangleF(15, 15, 290, 50);
            _labelQuestion.BackgroundColor = UIColor.Clear;
            _labelQuestion.Lines = 2;
            View.AddSubview(_labelQuestion);

            // Show button, triggers the answer being visible
            _buttonShow = new UnderlineButton();
            _buttonShow.Font = UIFont.SystemFontOfSize(16f);
            _buttonShow.SetTitle("Reveal answer...",UIControlState.Normal);
            _buttonShow.SetTitleColor(UIColor.Black,UIControlState.Normal);
            _buttonShow.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            _buttonShow.Frame = new RectangleF(15,80,120,25);
            _buttonShow.TouchDown += new EventHandler(ShowAnswer);
            View.AddSubview(_buttonShow);

            // The answer label
            _labelAnswer = new UILabel();
            _labelAnswer.Text = "";
            _labelAnswer.Font = UIFont.SystemFontOfSize(24f);
            _labelAnswer.TextColor = UIColor.Gray;
            _labelAnswer.Frame = new RectangleF(15, 140, 290, 180);
            _labelAnswer.BackgroundColor = UIColor.Clear;
            _labelAnswer.Lines = 7;
            View.AddSubview(_labelAnswer);

            // The 6 score buttons
            AddScoreButtons();

            // The first question, display it in the labels
            _currentQuestion = _questions[_questionIndex];
            BindQuestion(_currentQuestion);
        }
Пример #4
0
 /// <summary>
 /// click underline
 /// </summary>
 public void ClickUnderline()
 {
     UnderlineButton.Wait(3).Click();
 }