Esempio n. 1
0
        internal override void MessageRecieved(object sender, UiSettingsEventArgs e)
        {
            KeyEventArgs   eventArgsK;
            MouseEventArgs eventArgsM;

            if ((e.Flags & UiSettingsEventArgs.FLAGS_UI) != 0)
            {
                switch (e.Type)
                {
                case UiSettingsEventArgs.EventType.KeyUpEvent:
                    eventArgsK = (KeyEventArgs)(e.EventInfo);
                    //Insert on KeyUp Event here
                    switch (eventArgsK.KeyCode)
                    {
                    default:
                        break;
                    }

                    break;

                case UiSettingsEventArgs.EventType.KeyDownEvent:
                    eventArgsK = (KeyEventArgs)(e.EventInfo);
                    //Insert on KeyDown Event here

                    break;

                case UiSettingsEventArgs.EventType.KeyPressEvent:
                    eventArgsK = (KeyEventArgs)(e.EventInfo);
                    //Insert on KeyPress Event here

                    break;

                case UiSettingsEventArgs.EventType.MouseEvent:
                    if (e.EventInfo.GetType() == typeof(EventArgs))
                    {
                        //Insert on MouseClick Event here
                    }
                    else
                    {
                        eventArgsM = (MouseEventArgs)(e.EventInfo);
                        PointF mousept = new PointF(eventArgsM.X, eventArgsM.Y);

                        if ((e.Flags & UiSettingsEventArgs.FLAGS_UI_MOUSEDOWN) != 0)
                        {
                            //Insert on MouseDown Event here
                        }
                        else if ((e.Flags & UiSettingsEventArgs.FLAGS_UI_MOUSEUP) != 0)
                        {
                            MessageBox.Show(String.Format("X:{0}, Y:{1}", mousept.X, mousept.Y));
                        }
                        else
                        {
                            if (eventArgsM.Button == MouseButtons.Left)
                            {
                                //Insert on MouseDrag Event here
                            }
                        }
                    }
                    break;
                }
            }
        }
 internal abstract void MessageRecieved(object sender, UiSettingsEventArgs e);