ServerGroupCollection 类

注意:此 API 现在已过时。

The ServerGroupCollection class represents a collection of ServerGroup objects that represent all the server groups on the server group.

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Management.Smo.RegisteredServers. . :: . .RegSvrCollectionBase
    Microsoft.SqlServer.Management.Smo.RegisteredServers..::..ServerGroupCollection

命名空间:  Microsoft.SqlServer.Management.Smo.RegisteredServers
程序集:  Microsoft.SqlServer.SmoExtended(在 Microsoft.SqlServer.SmoExtended.dll 中)

语法

声明
<ObsoleteAttribute("Instead use namespace Microsoft.SqlServer.Management.RegisteredServers")> _
Public NotInheritable Class ServerGroupCollection _
    Inherits RegSvrCollectionBase _
    Implements ICollection, IEnumerable
用法
Dim instance As ServerGroupCollection
[ObsoleteAttribute("Instead use namespace Microsoft.SqlServer.Management.RegisteredServers")]
public sealed class ServerGroupCollection : RegSvrCollectionBase, 
    ICollection, IEnumerable
[ObsoleteAttribute(L"Instead use namespace Microsoft.SqlServer.Management.RegisteredServers")]
public ref class ServerGroupCollection sealed : public RegSvrCollectionBase, 
    ICollection, IEnumerable
[<SealedAttribute>]
[<ObsoleteAttribute("Instead use namespace Microsoft.SqlServer.Management.RegisteredServers")>]
type ServerGroupCollection =  
    class
        inherit RegSvrCollectionBase
        interface ICollection
        interface IEnumerable
    end
public final class ServerGroupCollection extends RegSvrCollectionBase implements ICollection, IEnumerable

ServerGroupCollection 类型公开以下成员。

属性

  名称 说明
公共属性 Count Gets the number of objects in the referenced collection.
公共属性 IsSynchronized 获取一个 Boolean 值,该值指示是否同步对集合的访问,并因此确保线程安全。 (从 RegSvrCollectionBase 继承。)
公共属性 Item[ ( [ ( Int32] ) ] ) Gets a ServerGroup object in the collection by index number.
公共属性 Item[ ( [ ( String] ) ] ) Gets a ServerGroup object in the collection by name.
公共属性 Parent Gets the ServerGroup object that is the parent of the ServerGroupCollection object.
公共属性 SyncRoot 获取用于同步对集合的访问的对象。 (从 RegSvrCollectionBase 继承。)

页首

方法

  名称 说明
公共方法 Add Adds a ServerGroup object to the ServerGroupCollection collection.
公共方法 Contains Determines whether the specified string value exists within the collection.
公共方法 CopyTo Copies the collection objects to a one-dimensional array beginning at the index value specified.
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
公共方法 GetEnumerator Returns an IEnumerator interface that lets you iterate through the objects in the collection.
公共方法 GetHashCode (从 Object 继承。)
公共方法 GetType (从 Object 继承。)
受保护方法 MemberwiseClone (从 Object 继承。)
公共方法 Remove Removes a ServerGroup object from the ServerGroupCollection object.
公共方法 ToString (从 Object 继承。)

页首

字段

  名称 说明
受保护字段 initialized 获取一个 Boolean 值,该值指示集合是否已初始化。如果为 True,则集合已初始化。如果为 False,则集合未初始化。 (从 RegSvrCollectionBase 继承。)
受保护字段 innerColl 包含已注册服务器的基础集合的 SortedList。 (从 RegSvrCollectionBase 继承。)

页首

注释

A ServerGroupCollection object can be used to gain access to a set of server groups. You can use the Item property to return a specific ServerGroup object.

示例

使用集合

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。