Beispiel #1
0
            public static void ViewRegisteredConnection()
            {
                UIFoundation.Popup registeredServersPopup = new UIFoundation.Popup()
                    {
                        TitleImage = UIFoundation.Helper.GetResourceBitmapSource(@"BOMBS.Client;component/Resources/server_connect.png"),
                        Caption = "Server Configuration",
                        PopupTitle = "Registered Server Connection",
                        TypeOfContent = typeof(Controls.ServerList),
                    };

                registeredServersPopup.ButtonCollection.ButtonSet = UIFoundation.Controls.DialogButtons.DialogType.CloseOnly;

                registeredServersPopup.Closing += registeredServersPopup_Closing;

                registeredServersPopup.ShowDialog();
            }
Beispiel #2
0
            public static bool CreateNewConnection(bool isShutDownWhenCancel = true)
            {
                UIFoundation.Popup popup = new UIFoundation.Popup()
                    {
                        TitleImage = UIFoundation.Helper.GetResourceBitmapSource(@"BOMBS.Client;component/Resources/server_connect.png"),
                        Caption = "New Server Configuration",
                        PopupTitle = "Create New Server Connection",
                        TypeOfContent = typeof(Controls.NewConnection),
                    };

                if (isShutDownWhenCancel)
                {
                    popup.Closing -= popup_Closing;
                    popup.Closing += popup_Closing;
                }

                WindowBase.DialogValue result = popup.ShowDialog();
                switch (result)
                {
                    case WindowBase.DialogValue.None:
                    case WindowBase.DialogValue.Incomplete:
                    case WindowBase.DialogValue.Failed:
                        if (isShutDownWhenCancel)
                            Application.Current.Shutdown();
                        break;
                    case WindowBase.DialogValue.Success:
                        ServiceController communicator = ServiceController.Communicator;

                        Server.ServerVariables serverConfiguration = ((Server.Controls.NewConnection)popup.DialogContent).ServerConfiguration;

                        communicator.ActiveServer = serverConfiguration;
                        communicator.UseNewHost();

                        communicator.WriteResources();
                        break;
                }

                return result == WindowBase.DialogValue.Success;
            }
Beispiel #3
0
            public static bool ViewServerDatabaseSettings()
            {
                UIFoundation.Popup popup = new UIFoundation.Popup()
                {
                    TitleImage = UIFoundation.Helper.GetResourceBitmapSource(@"BOMBS.Client;component/Resources/server_connect.png"),
                    Caption = "Server Database Connection",
                    PopupTitle = "Database Configuration for the Server",
                    TypeOfContent = typeof(Control)
                };

                popup.DialogButton.ButtonSet = UIFoundation.Controls.DialogButtons.DialogType.CloseOnly;

                return popup.ShowDialog() == WindowBase.DialogValue.Success;
            }