LinkLabel.LinkCollection LinkLabel.LinkCollection LinkLabel.LinkCollection LinkLabel.LinkCollection Class

定义

表示 LinkLabel 控件内链接的集合。Represents the collection of links within a LinkLabel control.

public: ref class LinkLabel::LinkCollection : System::Collections::IList
public class LinkLabel.LinkCollection : System.Collections.IList
type LinkLabel.LinkCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class LinkLabel.LinkCollection
Implements IList
继承
LinkLabel.LinkCollectionLinkLabel.LinkCollectionLinkLabel.LinkCollectionLinkLabel.LinkCollection
实现

注解

类存储LinkLabel控件中显示的链接。 LinkLabel.LinkCollectionThe LinkLabel.LinkCollection class stores the link displayed in the LinkLabel control. 集合中的每一项都是LinkLabel.Link类的一个实例,该类定义链接的信息。Each item in the collection is an instance of the LinkLabel.Link class, which defines the information of the link.

方法提供了将单个LinkLabel.Link添加到集合的功能。 AddThe Add method provides the ability to add a single LinkLabel.Link to the collection. 若要删除链接,你可以使用Remove方法RemoveAt或方法(如果你知道链接在集合中的位置)。To remove links, you can use either the Remove method or the RemoveAt method if you know where the link is located within the collection. 方法使你可以从集合中删除所有链接,而不是Remove使用方法一次删除一个链接。 ClearThe Clear method enables you to remove all links from the collection instead of using the Remove method to remove a single link at a time.

除了用于添加和删除项的方法和属性外,还LinkLabel.LinkCollection提供用于在集合中查找链接的方法。In addition to methods and properties for adding and removing items, the LinkLabel.LinkCollection also provides methods to find links within the collection. 使用Contains方法可以确定LinkLabel.Link是否为集合的成员。The Contains method enables you to determine whether a LinkLabel.Link is a member of the collection. 知道链接位于集合内后,可以使用IndexOf方法来确定链接在集合中的位置。Once you know that the link is located within the collection, you can use the IndexOf method to determine where the link is located within the collection.

构造函数

LinkLabel.LinkCollection(LinkLabel) LinkLabel.LinkCollection(LinkLabel) LinkLabel.LinkCollection(LinkLabel) LinkLabel.LinkCollection(LinkLabel)

初始化 LinkLabel.LinkCollection 类的新实例。Initializes a new instance of the LinkLabel.LinkCollection class.

属性

Count Count Count Count

获取集合中链接的数目。Gets the number of links in the collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

获取一个值,该值指示此集合是否是只读的。Gets a value indicating whether this collection is read-only.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置集合内指定索引处的链接。Gets or sets the link at the specified index within the collection.

Item[String] Item[String] Item[String] Item[String]

从集合中获取具有指定键的链接。Gets a link with the specified key from the collection.

LinksAdded LinksAdded LinksAdded LinksAdded

获取一个值,该值指示链接是否已添加到 LinkLabel.LinkCollection 中。Gets a value indicating whether links have been added to the LinkLabel.LinkCollection.

方法

Add(Int32, Int32) Add(Int32, Int32) Add(Int32, Int32) Add(Int32, Int32)

向集合添加链接。Adds a link to the collection.

Add(Int32, Int32, Object) Add(Int32, Int32, Object) Add(Int32, Int32, Object) Add(Int32, Int32, Object)

将链接以及要与该链接关联的信息添加到集合中。Adds a link to the collection with information to associate with the link.

Add(LinkLabel+Link) Add(LinkLabel+Link) Add(LinkLabel+Link) Add(LinkLabel+Link)

将具有指定值的链接添加到集合中。Adds a link with the specified value to the collection.

Clear() Clear() Clear() Clear()

清除集合中的所有链接。Clears all links from the collection.

Contains(LinkLabel+Link) Contains(LinkLabel+Link) Contains(LinkLabel+Link) Contains(LinkLabel+Link)

确定指定链接是否位于集合内。Determines whether the specified link is within the collection.

ContainsKey(String) ContainsKey(String) ContainsKey(String) ContainsKey(String)

返回一个值,该值指示集合是否包含具有指定键的链接。Returns a value indicating whether the collection contains a link with the specified key.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回要用来循环访问链接集合的枚举数。Returns an enumerator to use to iterate through the link collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(LinkLabel+Link) IndexOf(LinkLabel+Link) IndexOf(LinkLabel+Link) IndexOf(LinkLabel+Link)

返回集合内指定链接的索引。Returns the index of the specified link within the collection.

IndexOfKey(String) IndexOfKey(String) IndexOfKey(String) IndexOfKey(String)

检索指定键在整个集合中的第一个匹配项的从零开始的索引。Retrieves the zero-based index of the first occurrence of the specified key within the entire collection.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(LinkLabel+Link) Remove(LinkLabel+Link) Remove(LinkLabel+Link) Remove(LinkLabel+Link)

从集合中移除指定的链接。Removes the specified link from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除集合内指定位置处的链接。Removes a link at a specified location within the collection.

RemoveByKey(String) RemoveByKey(String) RemoveByKey(String) RemoveByKey(String)

移除具有指定键的链接。Removes the link with the specified key.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(Array, Int32)For a description of this member, see CopyTo(Array, Int32).

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

有关此成员的说明,请参见 IsSynchronizedFor a description of this member, see IsSynchronized.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

有关此成员的说明,请参见 SyncRootFor a description of this member, see SyncRoot.

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

有关此成员的说明,请参见 Add(Object)For a description of this member, see Add(Object).

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

有关此成员的说明,请参见 Contains(Object)For a description of this member, see Contains(Object).

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

有关此成员的说明,请参见 IndexOf(Object)For a description of this member, see IndexOf(Object).

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

有关此成员的说明,请参见 Insert(Int32, Object)For a description of this member, see Insert(Int32, Object).

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

有关此成员的说明,请参见 IsFixedSizeFor a description of this member, see IsFixedSize.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

有关此成员的说明,请参见 Item[Int32]For a description of this member, see Item[Int32].

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

有关此成员的说明,请参见 Remove(Object)For a description of this member, see Remove(Object).

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于