/// <summary>
        /// A dialogue box to type in passwords. Characters are masked with *.
        /// </summary>
        /// <param name="title">a title for the dialogue box</param>
        /// <param name="text">text label for the dialogue box</param>
        /// <returns>the password</returns>
        public static Primitive Password(Primitive title, Primitive text)
        {
            DialoguePassword dialogue = new DialoguePassword();

            Type GraphicsWindowType = typeof(GraphicsWindow);
            Window _window = (Window)GraphicsWindowType.GetField("_window", BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);

            InvokeHelperWithReturn ret = new InvokeHelperWithReturn(delegate
            {
                return dialogue.Show(title, text, _window);
            });
            MethodInfo method = GraphicsWindowType.GetMethod("InvokeWithReturn", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase);
            return method.Invoke(null, new object[] { ret }).ToString();
        }
Exemple #2
0
        /// <summary>
        /// A dialogue box to type in passwords. Characters are masked with *.
        /// </summary>
        /// <param name="title">a title for the dialogue box</param>
        /// <param name="text">text label for the dialogue box</param>
        /// <returns>the password</returns>
        public static Primitive Password(Primitive title, Primitive text)
        {
            DialoguePassword dialogue = new DialoguePassword();

            Type   GraphicsWindowType = typeof(GraphicsWindow);
            Window _window            = (Window)GraphicsWindowType.GetField("_window", BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);

            InvokeHelperWithReturn ret = new InvokeHelperWithReturn(delegate
            {
                return(dialogue.Show(title, text, _window));
            });
            MethodInfo method = GraphicsWindowType.GetMethod("InvokeWithReturn", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase);

            return(method.Invoke(null, new object[] { ret }).ToString());
        }