示例#1
0
 private static string ShowKeyboardInput(
     MGXna_Framework.PlayerIndex player,
     string title,
     string description,
     string defaultText,
     bool usePasswordMode)
 {
     throw new NotImplementedException();
 }
示例#2
0
 public static IAsyncResult BeginShowKeyboardInput(
     MGXna_Framework.PlayerIndex player,
     string title,
     string description,
     string defaultText,
     AsyncCallback callback,
     Object state)
 {
     return(BeginShowKeyboardInput(player, title, description, defaultText, callback, state, false));
 }
示例#3
0
        public static IAsyncResult BeginShowKeyboardInput(
            MGXna_Framework.PlayerIndex player,
            string title,
            string description,
            string defaultText,
            AsyncCallback callback,
            Object state,
            bool usePasswordMode)
        {
#if !WINDOWS_UAP
            ShowKeyboardInputDelegate ski = ShowKeyboardInput;

            return(ski.BeginInvoke(player, title, description, defaultText, usePasswordMode, callback, ski));
#else
            throw new NotImplementedException();
#endif
        }
示例#4
0
 public static void ShowMarketplace(MGXna_Framework.PlayerIndex player)
 {
 }
示例#5
0
        public static IAsyncResult BeginShowMessageBox(
            MGXna_Framework.PlayerIndex player,
            string title,
            string text,
            IEnumerable <string> buttons,
            int focusButton,
            MessageBoxIcon icon,
            AsyncCallback callback,
            Object state
            )
        {
#if !WINDOWS_UAP
            // TODO: GuideAlreadyVisibleException
            if (IsVisible)
            {
                throw new Exception("The function cannot be completed at this time: the Guide UI is already active. Wait until Guide.IsVisible is false before issuing this call.");
            }

            if (player != PlayerIndex.One)
            {
                throw new ArgumentOutOfRangeException("player", "Specified argument was out of the range of valid values.");
            }
            if (title == null)
            {
                throw new ArgumentNullException("title", "This string cannot be null or empty, and must be less than 256 characters long.");
            }
            if (text == null)
            {
                throw new ArgumentNullException("text", "This string cannot be null or empty, and must be less than 256 characters long.");
            }
            if (buttons == null)
            {
                throw new ArgumentNullException("buttons", "Value can not be null.");
            }

            ShowMessageBoxDelegate smb = ShowMessageBox;

            return(smb.BeginInvoke(title, text, buttons, focusButton, icon, callback, smb));
#else
            var tcs  = new TaskCompletionSource <int?>(state);
            var task = Task.Run <int?>(() => ShowMessageBox(title, text, buttons, focusButton, icon));
            task.ContinueWith(t =>
            {
                // Copy the task result into the returned task.
                if (t.IsFaulted)
                {
                    tcs.TrySetException(t.Exception.InnerExceptions);
                }
                else if (t.IsCanceled)
                {
                    tcs.TrySetCanceled();
                }
                else
                {
                    tcs.TrySetResult(t.Result);
                }

                // Invoke the user callback if necessary.
                if (callback != null)
                {
                    callback(tcs.Task);
                }
            });
            return(tcs.Task);
#endif
        }