Example #1
0
        public static Tuple <bool, T> Show <T>(string questionText, string title, T defaultValue, NumTextBox.Type type = NumTextBox.Type.Int)
        {
            var res = true;
            T   t   = default(T);

            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                InputBoxX nb = new InputBoxX
                {
                    Title        = title,
                    QuestionText = questionText,
                    Type         = type,
                    NumText      = defaultValue.ToString(),
                    Owner        = ControlHelper.GetTopWindow()
                };
                nb.ShowDialog();
                try
                {
                    t = (T)Convert.ChangeType(nb.NumText, typeof(T));
                }
                catch (FormatException) {}
                res = nb.Result;
            }));
            return(new Tuple <bool, T>(res, t));
        }
Example #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mb = ((ScriptPlugin.Theme.Control.InputBoxX)(target));
                return;

            case 2:
                this.InputTextBox = ((ScriptPlugin.Theme.Control.NumTextBox)(target));
                return;

            case 3:
                this.btnOK = ((ScriptPlugin.Theme.Control.FButton)(target));
                return;

            case 4:
                this.btnCancel = ((ScriptPlugin.Theme.Control.FButton)(target));
                return;
            }
            this._contentLoaded = true;
        }