コード例 #1
0
ファイル: vcLessonMenu.cs プロジェクト: Aspyroad/NathansWay
        // Global Level Handler
        private void GlobalButtonOpClick(NWButton btnOpButton, G__MathOperator _mathOperator)
        {
            // Turn off the old button
            NWButton tmpBtnViewOld = this.View.ViewWithTag(intOpHoldState) as NWButton;

            if (tmpBtnViewOld != null)
            {
                tmpBtnViewOld.ApplyUIUnHeld();
            }

            // If - handle toggle functionality if the button is the same
            // Else - set the new button state
            if (this.intOpHoldState == btnOpButton.Tag)
            {
                this.intOpHoldState = 0;
                _mathOperator       = G__MathOperator.All;
            }
            else
            {
                this.intOpHoldState   = btnOpButton.Tag;
                btnOpButton.HoldState = true;
            }
            this._vmLesson.FilterMathOperator = _mathOperator;
            // Refresh/re-query the view
            this.LoadLessonsFilteredAsync();
        }
コード例 #2
0
        public static string GetOp(G__MathOperator x)
        {
            // Try to get the result in the static Dictionary
            string result;

            if (_dict.TryGetValue(x, out result))
            {
                return(result);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        public object UICreateOperator(G__MathOperator mathOperator, string strChar)
        {
            // Create an operator
            var x = new vcOperatorText(mathOperator, strChar);

            x.IsAnswer   = this.IsAnswer;
            x.IsFreeFrom = this.IsFreeForm;
            x.IsReadOnly = !this.IsAnswer;

            this.IsAnswer   = false;
            this.IsFreeForm = false;
            // Add to output
            return(x as object);
        }
コード例 #4
0
 public vcOperatorText(G__MathOperator operatortype, string strOperator)
 {
     this._operatorType = operatortype;
     this._strOperator  = strOperator;
     Initialize();
 }