Beispiel #1
0
		void OnMenuSelected (SliderMenuItem menu)
		{
			Debug.WriteLine (IsPresented);

			IsPresented = false;	

			if (menu == null || menu == _selectedMenuItem) {
				return;
			}
			_displayPage = null;

			if (menu.TargetType.Equals (typeof(SignOutPage))) {
				HandleSignOut ();
				return;
			}
			_displayPage = (ContentPage)Activator.CreateInstance (menu.TargetType);
			Detail = new NavigationPage (_displayPage);
		
			if (_selectedMenuItem != null) {
				_selectedMenuItem.IsSelected = false;
			}

			_selectedMenuItem = menu;
			_selectedMenuItem.IsSelected = true;
		}
Beispiel #2
0
        void OnMenuSelected(SliderMenuItem menu)
        {
            Debug.WriteLine(IsPresented);

            IsPresented = false;

            if (menu == null || menu == _selectedMenuItem)
            {
                return;
            }
            _displayPage = null;

            if (menu.TargetType.Equals(typeof(SignOutPage)))
            {
                HandleSignOut();
                return;
            }
            _displayPage = (ContentPage)Activator.CreateInstance(menu.TargetType);
            Detail       = new NavigationPage(_displayPage);

            if (_selectedMenuItem != null)
            {
                _selectedMenuItem.IsSelected = false;
            }

            _selectedMenuItem            = menu;
            _selectedMenuItem.IsSelected = true;
        }
Beispiel #3
0
        public void ClickSliderMenu(SliderMenuItem item)
        {
            string selector = "#carousel > ol > li:nth-child(" + (int)(item + 1) + ")";
            var    element  = Browser.Driver.FindElement(By.CssSelector(selector));

            Browser.Click(element);
            Browser.Wait(TimeSpan.FromSeconds(1));
        }
Beispiel #4
0
 public static SliderMenuItem GetRightMenuItem(SliderMenuItem item)
 {
     if ((int)item == Enum.GetNames(item.GetType()).Count() - 1)
     {
         return((SliderMenuItem)(0));
     }
     else
     {
         return((SliderMenuItem)(item + 1));
     }
 }
Beispiel #5
0
 public static SliderMenuItem GetLeftMenuItem(SliderMenuItem item)
 {
     if ((int)item == 0)
     {
         return((SliderMenuItem)(Enum.GetNames(item.GetType()).Count() - 1));
     }
     else
     {
         return((SliderMenuItem)(item - 1));
     }
 }
Beispiel #6
0
        public bool IsSliderMenuItemActive(SliderMenuItem item)
        {
            string selector               = "#carousel > ol > li:nth-child(" + (int)(item + 1) + ")";
            var    element                = Browser.Driver.FindElement(By.CssSelector(selector));
            var    contentElement         = Browser.Driver.FindElement(By.CssSelector("#carousel > div > div.item.active > div > div > div > div > h1"));
            bool   isMenuItemActive       = element.GetAttribute("class").Contains("active");
            bool   isMenuContentDisplayed = contentElement.Text.Replace(" ", "").Contains(item.ToString());

            if (element.Displayed)
            {
                return(isMenuItemActive && isMenuContentDisplayed);
            }
            else
            {
                return(isMenuContentDisplayed);
            }
        }
Beispiel #7
0
        private void DrawSliderMenuItem(SliderMenuItem item)
        {
            DrawMenuPatch(item.Name, item.ItemX, item.ItemY);

            DrawMenuPatch("M_THERML", item.SliderX, item.SliderY);
            for (var i = 0; i < item.SliderLength; i++)
            {
                var x = item.SliderX + 8 * (1 + i);
                DrawMenuPatch("M_THERMM", x, item.SliderY);
            }

            var end = item.SliderX + 8 * (1 + item.SliderLength);

            DrawMenuPatch("M_THERMR", end, item.SliderY);

            var pos = item.SliderX + 8 * (1 + item.SliderPosition);

            DrawMenuPatch("M_THERMO", pos, item.SliderY);
        }