Exemplo n.º 1
0
        /// <summary>
        /// Starts an asynchronous data portal operation to
        /// execute a command object.
        /// </summary>
        /// <typeparam name="T">
        /// Type of object to execute.
        /// </typeparam>
        /// <param name="obj">
        /// Reference to the object to execute.
        /// </param>
        /// <param name="callback">
        /// Reference to method that will handle the
        /// asynchronous callback when the operation
        /// is complete.
        /// </param>
        /// <param name="userState">User state object.</param>
        public static void BeginExecute <T>(T obj, EventHandler <DataPortalResult <T> > callback, object userState) where T : IMobileObject
        {
            var dp = new DataPortal <T>();

            dp.ExecuteCompleted += callback;
            dp.BeginExecute(obj, userState);
        }