Esempio n. 1
0
        void OnClosing(object sender, FormClosingEventArgs e)
        {
            if (ValidAddress)
            {
                using (ApplicationManagerProxy applicationManager = new ApplicationManagerProxy(ServiceAddress))
                {
                    string[]      applicationsOnServer     = applicationManager.GetApplications();
                    List <string> applicationsOnServerList = new List <string>(applicationsOnServer);

                    Predicate <string> contain = (str) =>
                    {
                        return(applicationsOnServerList.Contains(str));
                    };
                    bool unsavedApps = !Array.TrueForAll(Applications, contain);
                    if (unsavedApps)
                    {
                        DialogResult result = MessageBox.Show("One or more applications have no users or roles defined. Closing the Credentials Manager application will delete those applications. Click OK to close or Cancel to continute using Credentials Manager.", "Credentials Manager", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
                        if (result == DialogResult.Cancel)
                        {
                            e.Cancel = true;
                            return;
                        }
                    }
                }
            }
        }
 void RefreshApplicationListView()
 {
     m_ApplicationListView.ClearItems();
     string[] applications = new string[] { };
     if (ValidAddress)
     {
         using (ApplicationManagerProxy applicationManager = new ApplicationManagerProxy(ServiceAddress))
         {
             applications = applicationManager.GetApplications();
         }
     }
     m_ApplicationListView.AddItems(applications, true);
     SelectedApplicationChanged();
 }
 void RefreshApplicationListView()
 {
    m_ApplicationListView.ClearItems();
    string[] applications = new string[] { };
    if(ValidAddress)
    {
       using(ApplicationManagerProxy applicationManager = new ApplicationManagerProxy(ServiceAddress))
       {
          applications = applicationManager.GetApplications();
       }
    }
    m_ApplicationListView.AddItems(applications,true);
    SelectedApplicationChanged();
 }
Esempio n. 4
0
      void OnClosing(object sender,FormClosingEventArgs e)
      {
         if(ValidAddress)
         {
            using(ApplicationManagerProxy applicationManager = new ApplicationManagerProxy(ServiceAddress))
            {
               string[] applicationsOnServer = applicationManager.GetApplications();
               List<string> applicationsOnServerList = new List<string>(applicationsOnServer);

               Predicate<string> contain = (str)=>
                                           {
                                              return applicationsOnServerList.Contains(str);
                                           };
               bool unsavedApps = !Array.TrueForAll(Applications,contain);
               if(unsavedApps)
               {
                  DialogResult result = MessageBox.Show("One or more applications have no users or roles defined. Closing the Credentials Manager application will delete those applications. Click OK to close or Cancel to continute using Credentials Manager.","Credentials Manager",MessageBoxButtons.OKCancel,MessageBoxIcon.Exclamation);
                  if(result == DialogResult.Cancel)
                  {
                     e.Cancel = true;
                     return;
                  }
               }
            }
         }
      }