Esempio n. 1
0
 private static void ExceptionScreen(Exception exception)
 {
     _executionContext.CurrentScreen = ScreenFactory.CreateScreen(_render,
                                                                  ScreenTypeEnum.Main, new CommandModel(null, exception.ToString()));
     _executionContext.Command = null;
     _render.Clear();
 }
Esempio n. 2
0
        private static void PerformCommand()
        {
            if (CommandIsNotAllowed())
            {
                return;
            }

            CommandExecutionResult result = null;

            try
            {
                result = CommandHandlerFactory
                         .Create(_executionContext.Command.CommandType)
                         .Execute(_executionContext.Command.Parameters,
                                  _executionContext.CurrentScreen.Model);
            }
            catch (Exception exception)
            {
                ExceptionScreen(exception);
                return;
            }

            _executionContext.CurrentScreen = result.NextScreenType.HasValue
                ? ScreenFactory.CreateScreen(_render, result.NextScreenType.Value, result.Model)
                : null;

            _executionContext.Command = null;

            _render.Clear();
        }
Esempio n. 3
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            if (elementName == "Alert Dialogs")
            {
                return(ScreenFactory.CreateScreen <AlertDialogsScreen>());
            }

            if (elementName == "Activity")
            {
                return(ScreenFactory.CreateScreen <ActivityScreen>());
            }

            if (elementName == "Fragment")
            {
                return(ScreenFactory.CreateScreen <FragmentScreen>());
            }

            if (elementName == "Notification")
            {
                return(ScreenFactory.CreateScreen <NotificationScreen>());
            }

            return(screen);
        }
Esempio n. 4
0
    static void Main(string[] args)
    {
        Screen screenDepartures = ScreenFactory.CreateScreen("Departure");
        Screen screenArrivals   = ScreenFactory.CreateScreen("Arrival");

        //Whatever you are doing with the screens here..


        Console.ReadLine();
    }
Esempio n. 5
0
        static void Main(string[] args)
        {
            ScreenFactory screenFactor = new ScreenFactory();

            screenFactor.CreateScreen(IScreenFactory.ScreenModel.Web).Draw();

            LoggerFactory loggerFactory = new LoggerFactory();

            loggerFactory.CreateLogger(ILoggerFactory.logger.DbLogger).Log();
        }
Esempio n. 6
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            if (elementName == "Incoming Message")
            {
                return(ScreenFactory.CreateScreen <IncomingMessageScreen>());
            }
            return(screen);
        }
Esempio n. 7
0
        static ApiDemoScreen()
        {
            var assembly = Assembly.GetExecutingAssembly();

            ModalDialogDetector = new AndroidModalDialogDetector(assembly, typeof(ApiDemoModalDialog));

            var unknownScreen = ScreenFactory.CreateScreen <NullApiDemoScreen>();

            ScreenDetector = new AndroidScreenDetector(assembly, typeof(ApiDemoScreen), unknownScreen);
        }
Esempio n. 8
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            if (elementName == "Context Menu")
            {
                return(ScreenFactory.CreateScreen <ContextMenuScreen>());
            }

            return(screen);
        }
Esempio n. 9
0
        public override Joyride.Platforms.Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            switch (elementName)
            {
            case "Long":
                return(ScreenFactory.CreateScreen <LongScreen>());

            default:
                return(screen);
            }
        }
Esempio n. 10
0
    public new Mobile CreateMobile(string maker, int memory, int size, int resolution, int volume, string material)
    {
        var screen  = ScreenFactory.CreateScreen(size, resolution);
        var battery = BatteryFactory.CreateBattery(volume, material);

        return(new Mobile
        {
            Maker = maker,
            Memory = memory,
            Screen = screen,
            Battery = battery
        });
    }
Esempio n. 11
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            switch (elementName)
            {
            case "Default Layout Animations":
                return(ScreenFactory.CreateScreen <DefaultLayoutAnimationsScreen>());

            default:
                return(screen);
            }
        }
Esempio n. 12
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            switch (elementName)
            {
            case "Scroll View":
                return(ScreenFactory.CreateScreen <ScrollViewScreen>());

            default:
                return(screen);
            }
        }
Esempio n. 13
0
    public static void Main(string[] args)
    {
        var chinaScreenFactory = new ScreenFactory();
        var i14 = chinaScreenFactory.CreateScreen(14, 720);
        var taiwanScreenfactory = new ScreenFactory();
        var i15 = taiwanScreenfactory.CreateScreen(15, 1024);

        var japanBatteryFactory = new BatteryFactory();
        var liIon = japanBatteryFactory.CreateBattery(400, "li-ion");
        var koreaBatteryFactory = new BatteryFactory();
        var nicd = koreaBatteryFactory.CreateBattery(500, "NiCd");

        var Apple  = new MobileFactory();
        var iPhone = GetIPhone(Apple);

        var Sumsung = new MobileFactory();
        var Galaxy  = Sumsung.CreateMobile("Sumsung", 128, 5, 720, 500, "NiCd");
    }
Esempio n. 14
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            switch (elementName)
            {
            case "App":
                return(ScreenFactory.CreateScreen <AppScreen>());

            case "Animation":
                return(ScreenFactory.CreateScreen <AnimationScreen>());

            case "Views":
                return(ScreenFactory.CreateScreen <ViewsScreen>());

            default:
                return(screen);
            }
        }
Esempio n. 15
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            switch (elementName)
            {
            case "Layouts":
                return(ScreenFactory.CreateScreen <LayoutsScreen>());

            case "Webview":
                return(ScreenFactory.CreateScreen <WebviewScreen>());

            case "Drag And Drop":
                return(ScreenFactory.CreateScreen <DragAndDropScreen>());

            default:
                return(screen);
            }
        }
Esempio n. 16
0
        public override Screen Tap(string elementName, bool precise = false)
        {
            var screen = base.Tap(elementName, precise);

            if (elementName == "Custom Title")
            {
                return(ScreenFactory.CreateScreen <CustomTitleScreen>());
            }

            if (elementName == "Presentation")
            {
                return(ScreenFactory.CreateScreen <PresentationScreen>());
            }

            if (elementName == "Quick Contacts Demo")
            {
                return(ScreenFactory.CreateScreen <QuickContactsDemoScreen>());
            }

            return(screen);
        }
Esempio n. 17
0
 public override Screen GoBack()
 {
     Driver.Navigate().Back();
     return(ScreenFactory.CreateScreen <AppScreen>());
 }
Esempio n. 18
0
 private static void MainScreen()
 {
     _executionContext.CurrentScreen = ScreenFactory.CreateScreen(_render,
                                                                  ScreenTypeEnum.Main, new CommandModel(Text.MainScreen.DefaultBody));
 }
Esempio n. 19
0
 public override void Launch()
 {
     base.Launch();
     CurrentScreen = ScreenFactory.CreateScreen <MainScreen>();
 }
Esempio n. 20
0
 public override void Close()
 {
     base.Close();
     CurrentScreen = ScreenFactory.CreateScreen <NullApiDemoScreen>();
 }
Esempio n. 21
0
 /// <summary>
 /// LoadedScreenName プロパティが示す Screen をロードします。
 /// このメソッドは非同期に呼び出されます。
 /// </summary>
 /// <returns>ロードされた Screen。</returns>
 protected virtual Screen LoadScreen()
 {
     return(ScreenFactory.CreateScreen(LoadedScreenName));
 }