Exemplo n.º 1
0
 public VMCertStoreServerNode(VMCertStoreServerDTO dto)
 {
     ServerDTO       = dto;
     IsLoggedIn      = false;
     IsDetailsLoaded = false;
     StoresInfo      = new Dictionary <string, CertBagItem> ();
 }
        public async void ConnectToServer(string server)
        {
            var serverDTO = VMCertStoreServerDTO.CreateInstance();

            Servernode = new VMCertStoreServerNode(serverDTO);
            ProgressWindowController pwc = new ProgressWindowController();
            IntPtr session = new IntPtr(0);

            string[] servers          = VMCertStoreSnapInEnvironment.Instance.LocalData.GetServerArray();
            LoginWindowController lwc = new LoginWindowController(servers);

            NSApplication.SharedApplication.BeginSheet(lwc.Window, this.Window, () =>
            {
            });
            nint result = NSApplication.SharedApplication.RunModalForWindow(lwc.Window);

            try
            {
                if (result == (nint)VMIdentityConstants.DIALOGOK)
                {
                    Servernode.ServerDTO.Server     = lwc.Server;
                    Servernode.ServerDTO.DomainName = lwc.DomainName;
                    Servernode.ServerDTO.UserName   = lwc.UserName;
                    Servernode.ServerDTO.Password   = lwc.Password;
                    NSApplication.SharedApplication.BeginSheet(pwc.Window, this.Window as NSWindow, () =>
                    {
                    });
                    session = NSApplication.SharedApplication.BeginModalSession(pwc.Window);
                    await Servernode.ServerDTO.LogintoServer(lwc.UserName, lwc.Password, lwc.DomainName);

                    if (Servernode.ServerDTO.IsLoggedIn == true)
                    {
                        InitialiseViews();
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadOutlineView", this);
                        Task.Run(() => Servernode.FillServerInfo());
                    }
                    else
                    {
                        UIErrorHelper.ShowAlert("Please check the login details or the user permissions.", "Unable to Login");
                    }
                }
            }
            catch (Exception e)
            {
                UIErrorHelper.ShowAlert("", e.Message);
            }
            finally
            {
                if (pwc.ProgressBar != null)
                {
                    pwc.ProgressBar.StopAnimation(pwc.Window);
                    pwc.Window.Close();
                    NSApplication.SharedApplication.EndModalSession(session);
                }
                Window.EndSheet(lwc.Window);
                lwc.Dispose();
            }
        }
Exemplo n.º 3
0
 public VecsTrustedCertsNode(VMCertStoreServerDTO dto, string storeName)
     : base(dto, storeName)
 {
     ImageIndex = SelectedImageIndex = (int)VMCertStoreImageIndex.TrustedCert;
     this.EnabledStandardVerbs = StandardVerbs.Refresh;
     DisplayName = "Trusted Certs";
     this.Tag    = storeName;
     InitConsole();
 }
Exemplo n.º 4
0
        public VecsPrivateKeysNode(VMCertStoreServerDTO dto, string storeName)
            : base(dto, storeName)
        {
            ImageIndex  = SelectedImageIndex = (int)VMCertStoreImageIndex.PrivateEntities;
            DisplayName = "Private Entities";
            this.Tag    = storeName;

            this.EnabledStandardVerbs = StandardVerbs.Refresh;

            InitConsole();
        }
Exemplo n.º 5
0
 public void RefreshMethod(VMCertStoreServerDTO dto)
 {
     if (dto == null)
     {
         RefreshAll();
     }
     else
     {
         AddServerNode(dto);
     }
 }
Exemplo n.º 6
0
        public VecsStoresNode(VMCertStoreServerDTO dto)
        {
            ServerDTO   = dto;
            DisplayName = "Vecs Stores";
            ImageIndex  = SelectedImageIndex = (int)VMCertStoreImageIndex.CertificateStore;
            this.EnabledStandardVerbs = StandardVerbs.Refresh;

            RefreshStores();

            this.ActionsPaneItems.Add(
                new Microsoft.ManagementConsole.Action(
                    "Create Store",
                    "Create Store",
                    -1,
                    ACTION_CREATE_STORE));
        }
        public VMCertStoreServerNode(VMCertStoreServerDTO dto)
            : base()
        {
            ServerDTO       = dto;
            DisplayName     = ServerDTO.Server;
            this.ImageIndex = this.SelectedImageIndex = (int)VMCertStoreImageIndex.Server;

            this.EnabledStandardVerbs = StandardVerbs.Delete | StandardVerbs.Refresh;

            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Login",
                                                                             "Login", -1, ACTION_LOGIN));
            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Check connectivity",
                                                                             "Check connectivity", -1, ACTION_CHECK_CONNECTIVITY));

            PopulateChildren();
        }
Exemplo n.º 8
0
        public VecsStoreNode(VMCertStoreServerDTO dto, string storeName)
        {
            DisplayName = storeName;
            StoreName   = storeName;
            ServerDTO   = dto;
            ImageIndex  = SelectedImageIndex = (int)VMCertStoreImageIndex.Store;
            if (MiscUtilsService.IsSystemStore(StoreName))
            {
                this.EnabledStandardVerbs = StandardVerbs.Refresh;
            }
            else
            {
                this.EnabledStandardVerbs = StandardVerbs.Refresh | StandardVerbs.Delete;
            }

            InitConsole();
        }
Exemplo n.º 9
0
        async void AddServer()
        {
            try
            {
                var ServerDTO = VMCertStoreServerDTO.CreateInstance();
                ServerDTO.Server = "";
                var node = new VMCertStoreServerNode(ServerDTO);
                await node.DoLogin();

                if (node.ServerDTO.IsLoggedIn)
                {
                    VMCertStoreSnapInEnvironment.Instance.LocalData.AddServer(node.ServerDTO);
                    this.Children.Add(node);
                }
            }
            catch (Exception e)
            {
                MMCDlgHelper.ShowException(e);
            }
        }
Exemplo n.º 10
0
 public CertificateDetailsListView(List <CertDTO> certList, VMCertStoreServerDTO dto, String store)
 {
     Entries   = certList;
     ServerDto = dto;
     Store     = store;
 }
Exemplo n.º 11
0
 public NodesListView(List <ScopeNode> nodesList, VMCertStoreServerDTO dto)
 {
     Entries   = nodesList;
     ServerDTO = dto;
 }
Exemplo n.º 12
0
 public VecsStoreEntriesNode(VMCertStoreServerDTO dto, string storeName)
 {
     StoreName = storeName;
     ServerDTO = dto;
     this.EnabledStandardVerbs = StandardVerbs.Refresh;
 }
Exemplo n.º 13
0
 public void AddServer(VMCertStoreServerDTO dto)
 {
     ServerList.Add(dto);
 }
Exemplo n.º 14
0
 public SecretKeysListView(List <CertDTO> certList, VMCertStoreServerDTO dto, String store)
 {
     Entries   = certList;
     ServerDto = dto;
     Store     = store;
 }
Exemplo n.º 15
0
        void AddServerNode(VMCertStoreServerDTO dto)
        {
            var node = new VMCertStoreServerNode(dto);

            this.Children.Add(node);
        }