예제 #1
0
 /// <summary>
 /// This event handler will be called whenever a new device of a given type arrives in the system.
 /// This is where you should opens the device you want to shows the applet on.
 /// Take special care for thread-safety as the SDK calls this handler in another thread.
 /// </summary>
 private void Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     // since with specified LcdAppletCapabilities.Qvga at the Applet's creation,
     // we will only receive QVGA arrival notifications.
     Debug.Assert(e.DeviceType == LcdDeviceType.Qvga);
     Invoke(OnQvgaDeviceArrived);
 }
예제 #2
0
 /// <summary>
 ///     This event handler will be called whenever a new device of a given type arrives in the system.
 ///     This is where you should opens the device you want to shows the applet on.
 ///     Take special care for thread-safety as the SDK calls this handler in another thread.
 /// </summary>
 private void Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     // since with specified LcdAppletCapabilities.Qvga at the Applet's creation,
     // we will only receive QVGA arrival notifications.
     Debug.Assert(e.DeviceType == LcdDeviceType.Qvga);
     this.Invoke(this.OnQvgaDeviceArrived);
 }
 // Event handler for new device arrical in the system.
 // Monochrome devices include (G510, G13, G15, Z10)
 private void DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     SetDeviceType(e.DeviceType);
     arrived = true;
     //inform main thread the device is avalable
     waitAutoResetEvent.Set();
 }
예제 #4
0
 static void _applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     switch (e.DeviceType)
     {
     case LcdDeviceType.Monochrome:
         _monoArrived = true;
         break;
     }
     _waitAre.Set();
 }
예제 #5
0
 /// <summary>
 /// This event handler will be called whenever a new device of a given type arrives in the system.
 /// This is where you should open the device where you want to show the applet.
 /// Take special care for thread-safety as the SDK calls this handler in another thread.
 /// </summary>
 private static void Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     Console.WriteLine("A device of type " + e.DeviceType + " was added.");
     switch (e.DeviceType)
     {
     // A monochrome device (G13/G15/Z10) was connected
     case LcdDeviceType.Monochrome:
         _monoArrived = true;
         break;
     }
     _waitAre.Set();
 }
        /// <summary>
        /// Event handler for new device arrival in the system.
        /// Monochrome devices include (G510, G13, G15, Z10).
        /// </summary>
        /// <param name="sender">Applet or device?</param>
        /// <param name="e">Device type event arguments</param>
        private static void AppletDeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            switch (e.DeviceType)
            {
            // A monochrome device (G13/G15/Z10) was connected
            case LcdDeviceType.Monochrome:
                lock (deviceArrivedLock)
                    deviceArrived = true;
                break;

            default:
                break;
            }
        }
예제 #7
0
        private static void Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            Console.WriteLine("A device of type " + e.DeviceType + " was added.");
            switch (e.DeviceType)
            {

                // A monochrome device (G13/G15/Z10) was connected
                case LcdDeviceType.Monochrome:
                    _monoArrived = true;
                    break;

            }
            _waitAre.Set();
        }
예제 #8
0
        void _Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            if (_Device == null)
            {
                Console.WriteLine("Device Arrived!");
                _Device = _Applet.OpenDeviceByType(e.DeviceType);
                _Device.SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(_Device_SoftButtonsChanged);

                Pages.Add("NewMessage", new MyLcdGdiPage(_Device, this));
                Pages["NewMessage"].SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(NewMessage_SoftButtonsChanged);
                Pages["NewMessage"].Updated            += new EventHandler <UpdateEventArgs>(LCDHandler_Updated);

                Pages["NewMessage"].Add("BG", new LcdGdiRectangle());
                Pages["NewMessage"].Get <LcdGdiRectangle>("BG").Size  = new System.Drawing.SizeF(_Device.PixelWidth, _Device.PixelHeight);
                Pages["NewMessage"].Get <LcdGdiRectangle>("BG").Brush = System.Drawing.Brushes.Black;

                Pages["NewMessage"].Add("Time", new LcdGdiText());
                Pages["NewMessage"].Get <LcdGdiText>("Time").Text = "";
                Pages["NewMessage"].Get <LcdGdiText>("Time").VerticalAlignment   = LcdGdiVerticalAlignment.Top;
                Pages["NewMessage"].Get <LcdGdiText>("Time").HorizontalAlignment = LcdGdiHorizontalAlignment.Left;
                textFont = new System.Drawing.Font(Pages["NewMessage"].Get <LcdGdiText>("Time").Font, System.Drawing.FontStyle.Bold);
                Pages["NewMessage"].Get <LcdGdiText>("Time").Font  = textFont;
                Pages["NewMessage"].Get <LcdGdiText>("Time").Brush = System.Drawing.Brushes.White;

                Pages["NewMessage"].Add("Author", new LcdGdiText());
                Pages["NewMessage"].Get <LcdGdiText>("Author").Text = "";
                Pages["NewMessage"].Get <LcdGdiText>("Author").VerticalAlignment   = LcdGdiVerticalAlignment.Top;
                Pages["NewMessage"].Get <LcdGdiText>("Author").HorizontalAlignment = LcdGdiHorizontalAlignment.Right;
                Pages["NewMessage"].Get <LcdGdiText>("Author").Font  = textFont;
                Pages["NewMessage"].Get <LcdGdiText>("Author").Brush = System.Drawing.Brushes.White;

                System.Drawing.StringFormat MessageFormat = new System.Drawing.StringFormat();
                MessageFormat.Alignment     = System.Drawing.StringAlignment.Center;
                MessageFormat.LineAlignment = System.Drawing.StringAlignment.Center;

                Pages["NewMessage"].Add("Message", new LcdGdiText());
                Pages["NewMessage"].Get <LcdGdiText>("Message").Text                = "";
                Pages["NewMessage"].Get <LcdGdiText>("Message").Margin              = new MarginF(0, 0, 0, 0);
                Pages["NewMessage"].Get <LcdGdiText>("Message").StringFormat        = MessageFormat;
                Pages["NewMessage"].Get <LcdGdiText>("Message").VerticalAlignment   = LcdGdiVerticalAlignment.Stretch;
                Pages["NewMessage"].Get <LcdGdiText>("Message").HorizontalAlignment = LcdGdiHorizontalAlignment.Stretch;
                Pages["NewMessage"].Get <LcdGdiText>("Message").Font                = textFont;
                Pages["NewMessage"].Get <LcdGdiText>("Message").Brush               = System.Drawing.Brushes.White;

                Pages["NewMessage"].SetAsCurrentDevicePage();
            }
        }
예제 #9
0
        // Event handler for new device arrical in the system.
        // Monochrome devices include (G510, G13, G15, Z10)
        private void appletDeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            switch (e.DeviceType)
            {
            // A monochrome device (G13/G15/Z10) was connected
            case LcdDeviceType.Monochrome:
                m_monoArrived = true;
                break;

            case LcdDeviceType.Qvga:
                m_qvgaArrived = true;
                break;

            default:
                break;
            }

            m_waitAutoResetEvent.Set();
        }
        private void applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            device_ = applet_.OpenDeviceByType(e.DeviceType);
            device_.SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(buttonPressed);

            settings_.setDevice(device_);
            device_.SetAsForegroundApplet = settings_.alwaysOnTop_;

            Screen startupScreen = new StartupScreen(device_, device_.DeviceType, null, this, 0);

            lcdScreenList_.Add(startupScreen);

            device_.CurrentPage = startupScreen;

            device_.DoUpdateAndDraw();

            if (mbApiInterface_.Player_GetPlayState() == PlayState.Playing)
            {
                openScreens();
            }
        }
 // Event handler for device removal
 private void DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     // nop
 }
예제 #12
0
 /// <summary>
 /// This event handler will be called whenever every device of a given type are disconnected from the system.
 /// You should stop using the device here.
 /// </summary>
 private static void Applet_DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     Console.WriteLine("A device of type " + e.DeviceType + " was removed.");
 }
예제 #13
0
 void _applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
 {
     TriggerEvent(OnDeviceArrival);
 }
예제 #14
0
 /// <summary>
 /// This event handler will be called whenever every device of a given type are disconnected from the system.
 /// You should stop using the device here.
 /// </summary>
 private static void Applet_DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
 }
예제 #15
0
 private static void Applet_DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     Console.WriteLine("A device of type " + e.DeviceType + " was removed.");
 }
예제 #16
0
 static void _applet_DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     ConsoleReporter.Report("Device disconnected!", ConsoleReporter.ReportStatus.Warning, _logEnabled);
 }
예제 #17
0
        /// <summary>
        /// This event handler will be called whenever a new device of a given type arrives in the system.
        /// This is where you should open the device where you want to show the applet.
        /// Take special care for thread-safety as the SDK calls this handler in another thread.
        /// </summary>
        private static void Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            switch (e.DeviceType)
            {

                // A monochrome device (G13/G15/Z10) was connected
                case LcdDeviceType.Monochrome:
                    _monoArrived = true;
                    break;

            }
            _waitAre.Set();
        }
예제 #18
0
        // Event handler for new device arrical in the system.
        // Monochrome devices include (G510, G13, G15, Z10)
        private void appletDeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            switch (e.DeviceType)
            {
                // A monochrome device (G13/G15/Z10) was connected
                case LcdDeviceType.Monochrome:
                    m_monoArrived = true;
                    break;
                case LcdDeviceType.Qvga:
                    m_qvgaArrived = true;
                    break;
                default:
                    break;
            }

            m_waitAutoResetEvent.Set();
        }
예제 #19
0
        private void _Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e)
        {
            if(_Device == null)
            {
                LcdDevice device = _Applet.OpenDeviceByType(e.DeviceType);
                _Device = new zLCDDevice(device);
                SetupDevice();
                _Device.SetAsForegroundApplet = true;

                runningTimer.Start();
            }
        }
예제 #20
0
 // Event handler for device removal
 private void appletDeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     // No action required
 }
 private void applet_DeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     Close(PluginCloseReason.StopNoUnload);
 }
예제 #22
0
 // Event handler for device removal
 private void appletDeviceRemoval(object sender, LcdDeviceTypeEventArgs e)
 {
     // No action required
 }