Esempio n. 1
0
        public static DeltaStateEvent *From(InputEventPtr ptr)
        {
            if (!ptr.valid)
            {
                throw new ArgumentNullException("ptr");
            }
            if (!ptr.IsA <DeltaStateEvent>())
            {
                throw new InvalidCastException(string.Format("Cannot cast event with type '{0}' into DeltaStateEvent",
                                                             ptr.type));
            }

            return((DeltaStateEvent *)ptr.data);
        }
Esempio n. 2
0
        public static unsafe TextEvent *From(InputEventPtr eventPtr)
        {
            if (!eventPtr.valid)
            {
                throw new ArgumentNullException("ptr");
            }
            if (!eventPtr.IsA <TextEvent>())
            {
                throw new InvalidCastException(string.Format("Cannot cast event with type '{0}' into TextEvent",
                                                             eventPtr.type));
            }

            return((TextEvent *)eventPtr.data);
        }