コード例 #1
0
ファイル: App.xaml.cs プロジェクト: zoujiaqing/MoSync
        private void SendScreenSizeChangedEvent()
        {
            Memory    eventData = new Memory(4);
            const int MAWidgetEventData_eventType = 0;

            eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.EVENT_TYPE_SCREEN_CHANGED);

            machine.GetRuntime().PostEvent(new Event(eventData));
        }
コード例 #2
0
        /**
         * The BackKeyPress event handler.
         * Currently it contains the functionality for the back event when a StackScreen is a child of a TabScreen.
         * When this handler does not cover the functionality required it should be updated.
         * @param from Object the object that triggers the event.
         * @param args System.ComponentModel.CancelEventArgs the event arguments.
         */
        public void BackKeyPressHandler(object from, System.ComponentModel.CancelEventArgs args)
        {
            NativeUIModule nativeUIModule = machine.GetRuntime().GetModule <NativeUIModule>();

            //EVENT_TYPE_KEY_RELEASED event data
            Memory    eventData                     = new Memory(8);
            const int MAEventData_eventType         = 0;
            const int MAEventData_backButtonKeyCode = 4;

            eventData.WriteInt32(MAEventData_eventType, MoSync.Constants.EVENT_TYPE_KEY_PRESSED);
            eventData.WriteInt32(MAEventData_backButtonKeyCode, MoSync.Constants.MAK_BACK);
            //Posting a CustomEvent
            machine.GetRuntime().PostEvent(new Event(eventData));

            args.Cancel = nativeUIModule.HandleBackButtonPressed();
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: ronald132/MoSync
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
#if !REBUILD
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");
#else
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
#endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                    machine.Run();
                }
            };
        }
コード例 #4
0
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
#if REBUILD
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
                    machine.Run();
#elif LIB
                    machine = MoSync.Machine.CreateMachineLib("resources");
                    MoSync.Machine.runMain();
#else
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");
                    machine.Run();
#endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                }
            };

            RootFrame.BackKeyPress += new EventHandler <System.ComponentModel.CancelEventArgs>(BackKeyPressHandler);
        }
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: jpsmaia/MoSync
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            //RootFrame.Navigated += delegate(object _sender, NavigationEventArgs _e)
            RootFrame.Loaded += delegate(object _sender, RoutedEventArgs _e)
            {
                if (machine == null)
                {
            #if !REBUILD
                    machine = MoSync.Machine.CreateInterpretedMachine("program", "resources");

            #else
                    machine = MoSync.Machine.CreateNativeMachine(new CoreNativeProgram(), "resources");
            #endif
                    InitExtensions(machine.GetCore(), machine.GetRuntime());
                    machine.Run();
                }
            };

            RootFrame.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(BackKeyPressHandler);
        }