예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GestureListener"/> class to receive specific gestures.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="configs">The gesture configurations.</param>
        public GestureListener( Control parent, GestureConfig[] configs )
        {
            if ( parent.IsHandleCreated )
            {
                Initialize( parent );
            }
            else
            {
                parent.HandleCreated += OnHandleCreated;
            }
            parent.HandleDestroyed += OnHandleDestroyed;

            m_configs = configs;
        }
예제 #2
0
 /// <summary>
 /// Registers the HWND to receive specific gestures.
 /// </summary>
 /// <remarks>
 /// http://msdn.microsoft.com/en-us/library/windows/desktop/dd353231%28v=vs.85%29.aspx
 /// </remarks>
 /// <param name="hwnd">The HWND.</param>
 /// <param name="configs">The gesture configurations</param>
 /// <returns></returns>
 public static bool SetGestureConfig( IntPtr hwnd, GestureConfig[] configs )
 {
     return _pSetGestureConfig( hwnd, 0, 1, configs, (uint)Marshal.SizeOf( typeof( GestureConfig ) ) );
 }