Ejemplo n.º 1
0
 private void cmdOk_Click(object sender, RoutedEventArgs e)
 {
     if (SuplexSecurityDalClient.ValidateServiceConnection(txtWebApiUrl.Text, out string exception))
     {
         WebApiUrl      = txtWebApiUrl.Text;
         txtStatus.Text = $"Connected to {txtWebApiUrl.Text}!";
         DialogResult   = true;
         Close();
     }
     else
     {
         txtStatus.Text = exception;
     }
 }
Ejemplo n.º 2
0
 private void mnuRecentConnection_Click(object sender, RoutedEventArgs e)
 {
     if (GlobalVerifySaveChanges())
     {
         string url = ((MenuItem)e.OriginalSource).Header.ToString();
         if (SuplexSecurityDalClient.ValidateServiceConnection(url, out string exception))
         {
             _dal.InitWebApiConnection(url);
         }
         else
         {
             MessageBox.Show(exception, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         }
     }
 }
Ejemplo n.º 3
0
        public MainDlg()
        {
            StyleManager.ApplicationTheme = new Office2016Theme(); //Expression_DarkTheme
            InitializeComponent();

            _dal        = new SuplexSecurityDalClient();
            DataContext = _dal;
            dlgSecureObjects.SplxDal      = _dal;
            dlgSecurityPrincipals.SplxDal = _dal;

            LoadMru();

            FileNew();

            //note: when compiling SuplexAdmin as a dll, comment the below lines and remove App.xaml/App.xaml.cs from project
            //best to backup/restore SuplexApp.csproj before/after compiling as dll, VisualStudio can sometimes fruit with project file in wierd ways
            //comment from here:
            if (App.StartUpDocumentIsValid)
            {
                OpenFile(App.StartUpDocument);
            }
            else if (App.CommandLineArgs.Count > 0)
            {
                if (App.CommandLineArgs.Keys.Contains("/config"))
                {
                    //placeholder
                    //this.OpenConfig( App.CommandLineArgs["/config"] );
                }
                else if (App.CommandLineArgs.Keys.Contains("/dbserver") && App.CommandLineArgs.Keys.Contains("/dbname"))
                {
                    if (App.CommandLineArgs.Keys.Contains("/dbuser") && App.CommandLineArgs.Keys.Contains("/dbpswd"))
                    {
                        //placeholder
                    }
                }
            }
            //:to here
        }