Пример #1
0
        /// <summary>
        /// Refreshes the psc table view.
        /// </summary>
        void RefreshPscTableView()
        {
            var serverDto = new ServerDto {
                Server   = _mgmtDto.Name,
                UserName = ServerDto.UserName,
                Upn      = ServerDto.Upn,
                Password = ServerDto.Password
            };

            if (_isConnected)
            {
                //var mgmtDto = _service.GetManagementNodeDetails (serverDto);
                var mgmtDto = RootNode.Hosts.FirstOrDefault(x => x.Sitename == _mgmtDto.Sitename && x.Name == _mgmtDto.Name) as ManagementDto;

                if (mgmtDto != null)
                {
                    var infraNodes = FilterBySiteName(mgmtDto.DomainControllers);
                    if (_mgmtDto.DomainController != null)
                    {
                        DomainControllerTextField.StringValue = _mgmtDto.DomainController.Name;

                        foreach (var node in infraNodes)
                        {
                            node.IsAffinitized = (node.Name == _mgmtDto.DomainController.Name || node.Ip == _mgmtDto.DomainController.Ip);
                        }
                    }
                    PscTableView.Delegate   = new MonitorTableViewDelegate(this);
                    PscDataSource           = new PscDataSource(infraNodes);
                    PscTableView.DataSource = PscDataSource;
                    PscTableView.ReloadData();

                    if (infraNodes != null && infraNodes.Count > 0 && PscTableView.SelectedRowCount <= 0)
                    {
                        PscTableView.SelectRow(0, true);
                    }

                    if (_mgmtDto.State != null)
                    {
                        Health health     = CdcDcStateHelper.GetHealth(_mgmtDto.State, infraNodes);
                        var    healthText = health.ToString().ToUpper();
                        CurrentStatusTextField.StringValue = healthText;
                        CurrentStatusTextField.TextColor   = GetHealthColor(health);
                        var healthDesc = CdcDcStateHelper.GetHealthDescription(health);
                        CurrentStatusTextField.ToolTip = healthDesc;
                    }
                    SiteAffinityButton.Title = "Enable " + (_mgmtDto.Legacy ? Constants.HA : Constants.Legacy);
                    LegacyModeWarning.Hidden = !_mgmtDto.Legacy;
                    LoadServices();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Initialize this instance.
        /// </summary>
        private void Initialize()
        {
            ServicesTableView.AddColumn(NSTableColumnHelper.ToNSTableColumn(Constants.TableColumnIconId, string.Empty, true, 20));
            ServicesTableView.MoveColumn(ServicesTableView.ColumnCount - 1, 0);

            PscTableView.AddColumn(NSTableColumnHelper.ToNSTableColumn(Constants.TableColumnIconId, string.Empty, true, 20));
            PscTableView.MoveColumn(PscTableView.ColumnCount - 1, 0);

            isAutoRefresh                      = false;
            lastRefreshTimestamp               = DateTime.Now.ToString(Constants.DateFormat);
            SiteAffinityButton.Activated      += SiteAffinityButton_Activated;
            AutoRefreshButton.Activated       += AutoRefreshButton_Activated;
            IntervalComboBox.SelectionChanged += IntervalComboBox_SelectionChanged;
            RefreshButton.Activated           += RefreshState_Activated;
            timer = new Timer(timerAutoRefresh_Tick, null, -1, -1);
        }
Пример #3
0
        void ReleaseDesignerOutlets()
        {
            if (AutoRefreshButton != null)
            {
                AutoRefreshButton.Dispose();
                AutoRefreshButton = null;
            }

            if (ContentPanel != null)
            {
                ContentPanel.Dispose();
                ContentPanel = null;
            }

            if (CurrentStatusTextField != null)
            {
                CurrentStatusTextField.Dispose();
                CurrentStatusTextField = null;
            }

            if (DomainControllerTextField != null)
            {
                DomainControllerTextField.Dispose();
                DomainControllerTextField = null;
            }

            if (HealthtextField != null)
            {
                HealthtextField.Dispose();
                HealthtextField = null;
            }

            if (HostnameHeader != null)
            {
                HostnameHeader.Dispose();
                HostnameHeader = null;
            }

            if (HostnameServiceHeaderTextField != null)
            {
                HostnameServiceHeaderTextField.Dispose();
                HostnameServiceHeaderTextField = null;
            }

            if (IntervalComboBox != null)
            {
                IntervalComboBox.Dispose();
                IntervalComboBox = null;
            }

            if (IpAddressTextField != null)
            {
                IpAddressTextField.Dispose();
                IpAddressTextField = null;
            }

            if (LastRefreshTextField != null)
            {
                LastRefreshTextField.Dispose();
                LastRefreshTextField = null;
            }

            if (LegacyModeWarning != null)
            {
                LegacyModeWarning.Dispose();
                LegacyModeWarning = null;
            }

            if (PscTableView != null)
            {
                PscTableView.Dispose();
                PscTableView = null;
            }

            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }

            if (ServicesheaderTextField != null)
            {
                ServicesheaderTextField.Dispose();
                ServicesheaderTextField = null;
            }

            if (ServicesTableView != null)
            {
                ServicesTableView.Dispose();
                ServicesTableView = null;
            }

            if (SiteAffinityButton != null)
            {
                SiteAffinityButton.Dispose();
                SiteAffinityButton = null;
            }

            if (SitenameTextField != null)
            {
                SitenameTextField.Dispose();
                SitenameTextField = null;
            }

            if (StatusTextField != null)
            {
                StatusTextField.Dispose();
                StatusTextField = null;
            }
        }