コード例 #1
0
        protected void LoadConnectionGroups(
            ConnectionType connectionType,
            ConnectionsManager connectionsManager)
        {
            List <ConnectionGroupInfo> groups = connectionsManager
                                                .GetDirectGroups(connectionType.Id);

            foreach (ConnectionGroupInfo groupInfo in groups)
            {
                List <InstanceInfo> instances     = groupInfo.Connections;
                InstanceInfo        firstInstance = instances.FirstOrDefault();

                if (firstInstance != null)
                {
                    if (instances.Count == 1 && firstInstance.GetConnectionString().Equals(groupInfo.Name))
                    {
                        continue;
                    }

                    if (!instances.TrueForAll(i => i.IsDynamicConnection))
                    {
                        this.cmbConnection.Items.Add(groupInfo);
                    }
                }
            }
        }