Ejemplo n.º 1
0
        /// <summary>
        /// The executable entry point.
        /// </summary>
        public static void Main()
        {
            MySimpleWPFApplication myApplication = new MySimpleWPFApplication();

            mainWindow = new MainMenuWindow(myApplication);

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            // Load the fonts.
            NinaBFont = Resources.GetFont(Resources.FontResources.NinaBFont);
            SmallFont = Resources.GetFont(Resources.FontResources.SmallFont);

            // Start the application.
            myApplication.Run(mainWindow);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The executable entry point.
        /// </summary>
        public static void Main()
        {
            MySimpleWPFApplication myApplication = new MySimpleWPFApplication();

            mainWindow = new MainMenuWindow(myApplication);

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            // Load the fonts.
            NinaBFont = Resources.GetFont(Resources.FontResources.NinaBFont);
            SmallFont = Resources.GetFont(Resources.FontResources.SmallFont);

            // Start the application.
            myApplication.Run(mainWindow);
        }
            /// <summary>
            /// Constructs a ButtonPad object that handles the emulated
            /// hardware's button interrupts.
            /// </summary>
            /// <param name="sink"></param>
            /// <param name="button"></param>
            /// <param name="pin"></param>
            public ButtonPad(GPIOButtonInputProvider sink, Button button,
                             Cpu.Pin pin)
            {
                this.sink   = sink;
                this.button = button;
#if !MF_FRAMEWORK_VERSION_V3_0
                this.buttonDevice = InputManager.CurrentInputManager.ButtonDevice;
#endif

                /// Do not set an InterruptPort with GPIO_NONE.
                if (pin != Cpu.Pin.GPIO_NONE)
                {
                    // When this GPIO pin is true, call the Interrupt method.
                    port = new InterruptPort(pin, true,
                                             Port.ResistorMode.PullUp,
                                             Port.InterruptMode.InterruptEdgeBoth);
                    port.OnInterrupt += new NativeEventHandler(this.Interrupt);
                }
            }
            /// <summary>
            /// Constructs a ButtonPad object that handles the emulated 
            /// hardware's button interrupts.
            /// </summary>
            /// <param name="sink"></param>
            /// <param name="button"></param>
            /// <param name="pin"></param>
            public ButtonPad(GPIOButtonInputProvider sink, Button button,
                Cpu.Pin pin)
            {
                this.sink = sink;
                this.button = button;
#if !MF_FRAMEWORK_VERSION_V3_0
                this.buttonDevice = InputManager.CurrentInputManager.ButtonDevice;
#endif

                /// Do not set an InterruptPort with GPIO_NONE.
                if (pin != Cpu.Pin.GPIO_NONE)
                {
                    // When this GPIO pin is true, call the Interrupt method.
                    port = new InterruptPort(pin, true,
                        Port.ResistorMode.PullUp,
                        Port.InterruptMode.InterruptEdgeBoth);
                    port.OnInterrupt += new NativeEventHandler(this.Interrupt);
                }
            }