Defines a base class for input reports. To use input reports, use the SetData method and override the ProcessData method.
Inheritance: Report
コード例 #1
0
ファイル: VioletMirror.cs プロジェクト: suan/mirlite
        protected override void HandleDataReceived(InputReport inputReport)
        {
            var report = (InputEvent)inputReport;
            // Fire generic data received event
            if (DataRecieved != null)
            {

                if (report.EventType != EventType.Unspecified)
                {
                    var args = new MirrorEventReceivedArgs(report);
                    DataRecieved(this, args);
                }
            }
            // Fire specific events
            switch (report.EventType)
            {
                case EventType.ShowTag:
                    if (TagShown != null) TagShown(this, new TagEventArgs(report.Data));
                    break;
                case EventType.HideTag:
                    if (TagHid != null) TagHid(this, new TagEventArgs(report.Data));
                    break;
                case EventType.OrientationDown :
                    if( OrientationChanged != null )
                        OrientationChanged(this, new OrientationChangedEventArgs(Orientation.Down));
                    break;
                case EventType.OrientationUp :
                    if( OrientationChanged != null )
                        OrientationChanged(this, new OrientationChangedEventArgs(Orientation.Up));
                    break;
            }
        }
コード例 #2
0
 /// <summary>
 /// virtual handler for any action to be taken when data is received. Override to use.
 /// </summary>
 /// <param name="inputReport">The input report that was received</param>
 protected virtual void HandleDataReceived(InputReport inputReport)
 {
 }