private void editCallback(EditOutput output)
        {
            this.Dispatcher.BeginInvoke(delegate()
            {
                buttonProgressBar.Visibility = System.Windows.Visibility.Collapsed;
                button.IsEnabled             = true;
                if (output == null)
                {
                    MessageBox.Show("Couldn't connect to server");
                }
                else if (output.status == "ok")
                {
                    var servers = new ObservableCollection <Server>(from Server s in MDEDB.Servers where s.serverName == server.serverName select s);
                    server.name = nameBox.Text;
                    server.pass = newPasswordBox.Password;
                    MDEDB.SubmitChanges();

                    MessageBox.Show("Logged in on server.");
                    NavigationService.GoBack();
                }
                else
                {
                    MessageBox.Show(output.reason);
                }
            });
        }
        private void editCallback(EditOutput output)
        {
            this.Dispatcher.BeginInvoke(delegate()
            {
                buttonProgressBar.Visibility = System.Windows.Visibility.Collapsed;
                button.IsEnabled = true;
                if (output == null)
                {
                    MessageBox.Show("Couldn't connect to server");
                }
                else if (output.status == "ok")
                {
                    var servers = new ObservableCollection<Server>(from Server s in MDEDB.Servers where s.serverName == server.serverName select s);
                    server.name = nameBox.Text;
                    server.pass = newPasswordBox.Password;
                    MDEDB.SubmitChanges();

                    MessageBox.Show("Logged in on server.");
                    NavigationService.GoBack();
                }
                else
                {
                    MessageBox.Show(output.reason);
                }
            });
        }
Esempio n. 3
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            var svc   = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            var codes = value as string;

            if (svc != null && codes != null)
            {
                DrawableObject obj   = context.Instance as DrawableObject;
                DrawingSheet   sheet = obj.OwnerDraw.OwnerSheet;

                using (var form = new EditOutput(VariableCollection.GetOutputsDictionary(sheet), value as string))
                {
                    if (svc.ShowDialog(form) == DialogResult.OK)
                    {
                        value = form.Tag.ToString() == "" ? null : form.Tag;
                    }
                }
            }
            return(value);
        }