Пример #1
0
 public VMDNSReverseZonesNode(VMDNSServerNode node)
     : base(node)
 {
     this.DisplayName = VMDNSConstants.REVERSEZONE;
     this.ZoneType    = (int)VmDnsZoneType.REVERSE;
     RefreshChildren();
 }
Пример #2
0
        public async void ConnectToServer(string server)
        {
            var serverDTO = VMDNSServerDTO.CreateInstance();

            serverNode = new VMDNSServerNode(serverDTO);
            string[] servers             = VMDNSSnapInEnvironment.instance.LocalData.GetServerArray();
            ProgressWindowController pwc = new ProgressWindowController();
            IntPtr session            = new IntPtr(0);
            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);
                    //use await here and make it async
                    await serverNode.ServerDTO.LoginToServer();

                    if (serverNode.ServerDTO.IsLoggedIn == true)
                    {
                        serverNode.FillZonesInfo();
                        InitialiseViews();
                        ReloadOutlineView(null);
                    }
                    else
                    {
                        UIErrorHelper.ShowAlert(string.Empty, VMIdentityConstants.SERVER_CONNECT_ERROR);
                    }
                }
            }
            catch (Exception e)
            {
                UIErrorHelper.ShowAlert(string.Empty, 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();
            }
        }
Пример #3
0
        public ServerOptions(VMDNSServerNode node)

        {
            this.ServerNode = node;

            InitializeComponent();

            ServerNode.FillForwarders();

            this.ForwardersList.DataSource = ServerNode.Forwarders;
        }
Пример #4
0
 public VMDNSRootScopeNode(VMDNSServerNode node)
 {
     this.ServerNode  = node;
     this.DisplayName = ServerNode.ServerDTO.Server;
 }