Пример #1
0
        private void UpdateDetails()
        {
            if (_updatingDataSource)
            {
                return;
            }

            var row = gridViewNetworkList.GetFocusedRow() as NetworkResponse;

            textId.Text          = row != null ? row.ID : string.Empty;
            textName.Text        = row != null ? row.Name : string.Empty;
            textCreatedDate.Text = row != null?row.Created.ToShortDateString() : string.Empty;

            var driver = row != null ? row.Driver : string.Empty;

            textDriver.Text     = driver != "null" ? driver : string.Empty;
            textScope.Text      = row != null ? row.Scope : string.Empty;
            textAttachable.Text = row != null?HelperFunctions.BooleanToText(row.Attachable) : string.Empty;

            textIPv6Enabled.Text = row != null?HelperFunctions.BooleanToText(row.EnableIPv6) : string.Empty;

            textInternal.Text = row != null?HelperFunctions.BooleanToText(row.Internal) : string.Empty;

            textIPAMConfig.Text = row != null ? row.IPAM.Driver : string.Empty;
            using (var token = gridControlState.StoreViewState(gridViewIPAMConfig))
                gridIPAMConfig.DataSource = row?.IPAM.Config?.ToList();

            using (var token = gridControlState.StoreViewState(gridViewIPAMOptions))
                gridIPAMOptions.DataSource = row?.IPAM.Options?.ToList();

            using (var token = gridControlState.StoreViewState(gridViewOptions))
                gridOptions.DataSource = row?.Options?.ToList();

            using (var token = gridControlState.StoreViewState(gridViewLabels))
                gridLabels.DataSource = row?.Labels?.ToList();

            // Not yet setup - No known way of getting sample data yet!
            // Containers
            // Peers

            UpdateButtons();
        }