Beispiel #1
0
        private void AddTenantNode(AuthTokenDto tokenDto, TenantDto tenant)
        {
            var node = new TenantNode(_serverDto, tenant.Name)
            {
                DisplayName = tenant.Name, Tag = tenant.Guid
            };

            AddTenantNode(node);
        }
Beispiel #2
0
        private void AddTenantNode(AuthTokenDto tokenDto, string tenantName)
        {
            var tenantDto = new TenantDto {
                Name = tenantName
            };
            var node = new TenantNode(_serverDto, tenantName)
            {
                DisplayName = tenantName, Tag = tenantName
            };

            AddTenantNode(node);
        }
Beispiel #3
0
        private void AddTenantNode(ServerNode serverNode, TenantNode node)
        {
            var nodeWithSameNameExists = false;
            var index = 0;

            while (index < serverNode.Children.Count)
            {
                var tenantNode = (TenantNode)serverNode.Children[index++];
                if (tenantNode.DisplayName == node.DisplayName)
                {
                    nodeWithSameNameExists = true;
                    break;
                }
            }

            if (!nodeWithSameNameExists)
            {
                serverNode.Children.Add(node);
            }
        }
Beispiel #4
0
        private void AddTenantNode(TenantNode node)
        {
            var nodeWithSameNameExists = false;
            var index = 0;

            while (index < Children.Count)
            {
                var tenantNode = (TenantNode)Children[index++];
                if (tenantNode.DisplayName == node.DisplayName)
                {
                    nodeWithSameNameExists = true;
                    break;
                }
            }

            if (nodeWithSameNameExists)
            {
                Children.RemoveAt(index - 1);
            }
            Children.Add(node);
        }