Example #1
0
        public static RecipeStep[] getRecipeSteps(int mealId)
        {
            JsonValue returnedSteps;
            if (mealId == 146 || mealId == 148) {
                if (CachedData.Instance.unitSystem == "U.S.") {
                    returnedSteps = steps146_US;
                } else {
                    returnedSteps = steps146_M;
                }
            } else {
                returnedSteps = getJSONResponse ("/Steps?mealid=" + mealId);
            }

            RecipeStep[] steps = new RecipeStep[returnedSteps.Count];
            for (int i = 0; i < returnedSteps.Count; i++) {
                JsonValue currentItem = returnedSteps [i];
                RecipeStep currentStep = new RecipeStep ();
                currentStep.title = currentItem ["Taskname"];
                currentStep.desc = currentItem["Taskdesc"];
                currentStep.time = currentItem ["Tasktime"];
                //currentStep.timeable = currentItem ["Tasktimeable"];
                if(i > 1 && i < 4) //For testing
                    currentStep.timeable = true;
                if (currentStep.timeable)
                    currentStep.timerHandler = new RecipeStepTimerHandler (currentStep.title, currentStep.time);
                steps [i] = currentStep;
            }
            return steps;
        }
Example #2
0
 public static RecipeStep[] getRecipeSteps(int mealId)
 {
     JsonValue returnedSteps = getJSONResponse ("/Steps?mealid=" + mealId);
     RecipeStep[] steps = new RecipeStep[returnedSteps.Count];
     for (int i = 0; i < returnedSteps.Count; i++) {
         JsonValue currentItem = returnedSteps [i];
         RecipeStep currentStep = new RecipeStep ();
         currentStep.title = currentItem ["Taskname"];
         currentStep.desc = currentItem["Taskdesc"];
         currentStep.time = currentItem ["Tasktime"];
         //currentStep.timeable = currentItem ["Tasktimeable"];
         if(i > 1 && i < 4) //For testing
             currentStep.timeable = true;
         if (currentStep.timeable)
             currentStep.timerHandler = new RecipeStepTimerHandler (currentStep.time, currentStep.title);
         steps [i] = currentStep;
     }
     return steps;
 }
Example #3
0
 public StepFragmentPagerAdapter(Android.Support.V4.App.FragmentManager fm, RecipeStep[] steps, TimerPoolHandler handler)
     : base(fm)
 {
     this.steps = steps;
     this.handler = handler;
 }
Example #4
0
 public StepFragment(RecipeStep s, TimerPoolHandler h)
 {
     this.recipeStep = s;
     this.handler = h;
 }