EditorPartCollection EditorPartCollection EditorPartCollection EditorPartCollection Class

定义

包含一个 EditorPart 控件的集合,这些控件用于编辑 WebPart 控件的属性、布局、外观和行为。Contains a collection of EditorPart controls used for editing the properties, layout, appearance, and behavior of WebPart controls. 此类不能被继承。This class cannot be inherited.

public ref class EditorPartCollection sealed : System::Collections::ReadOnlyCollectionBase
public sealed class EditorPartCollection : System.Collections.ReadOnlyCollectionBase
type EditorPartCollection = class
    inherit ReadOnlyCollectionBase
Public NotInheritable Class EditorPartCollection
Inherits ReadOnlyCollectionBase
继承
EditorPartCollectionEditorPartCollectionEditorPartCollectionEditorPartCollection

示例

下面的代码示例演示了EditorPartCollection类的几个用途。The following code example demonstrates several uses of the EditorPartCollection class. 此代码示例分为四个部分:There are four parts to this code example:

  • 使您能够在 Web 部件页上更改显示模式的用户控件。A user control that enables you to change display modes on a Web Parts page.

  • 一个名WebPart TextDisplayWebPart为的自定义控件的类, 该控件在网页中引用EditorPart并由控件进行编辑。A class for a custom WebPart control named TextDisplayWebPart, which is referenced in the Web page and is edited by the EditorPart controls.

  • 引用TextDisplayWebPart控件的网页, 包含一个EditorZone EditorPart控件, 其中包含在区域中声明的 Web 部件控件集中的多个控件, 并包含一些事件驱动的代码, 用于创建和操作EditorPartCollection对象。A Web page that references the TextDisplayWebPart control, contains an EditorZone control with several of the EditorPart controls from the Web Parts control set declared in the zone, and contains some event-driven code to create and manipulate an EditorPartCollection object.

  • 说明如何在浏览器中加载代码示例。An explanation of how the code example works when you load it in a browser.

此代码示例的第一部分是用户控件, 该控件使用户能够更改网页上的显示模式。The first part of this code example is the user control that enables users to change display modes on a Web page. 有关显示模式的详细信息以及此控件中源代码的说明, 请参阅演练:更改 Web 部件页上的显示模式。For details about display modes and a description of the source code in this control, see Walkthrough: Changing Display Modes on a Web Parts Page.

<%@ control language="C#" classname="DisplayModeMenuCS"%>

<script runat="server">
  
 // Use a field to reference the current WebPartManager.
  WebPartManager _manager;

  void Page_Init(object sender, EventArgs e)
  {
    Page.InitComplete += new EventHandler(InitComplete);
  }  

  void InitComplete(object sender, System.EventArgs e)
  {
    _manager = WebPartManager.GetCurrentWebPartManager(Page);

    String browseModeName = WebPartManager.BrowseDisplayMode.Name;

    // Fill the dropdown with the names of supported display modes.
    foreach (WebPartDisplayMode mode in _manager.SupportedDisplayModes)
    {
      String modeName = mode.Name;
      // Make sure a mode is enabled before adding it.
      if (mode.IsEnabled(_manager))
      {
        ListItem item = new ListItem(modeName, modeName);
        DisplayModeDropdown.Items.Add(item);
      }
    }
  }
 
  // Change the page to the selected display mode.
  void DisplayModeDropdown_SelectedIndexChanged(object sender, 
    EventArgs e)
  {
    String selectedMode = DisplayModeDropdown.SelectedValue;

    WebPartDisplayMode mode = 
      _manager.SupportedDisplayModes[selectedMode];
    if (mode != null)
      _manager.DisplayMode = mode;

  }

  void Page_PreRender(object sender, EventArgs e)
  {
    DisplayModeDropdown.SelectedValue = 
      _manager.DisplayMode.Name;
  }

</script>
<div>
  <asp:Panel ID="Panel1" runat="server" 
    Borderwidth="1" 
    Width="125" 
    BackColor="lightgray"
    Font-Names="Verdana, Arial, Sans Serif" >
  <asp:Label ID="Label1" runat="server" 
    Text="&nbsp;Display Mode" 
    Font-Bold="true"
    Font-Size="8"
    Width="120" 
    AssociatedControlID="DisplayModeDropdown"/>
  <asp:DropDownList ID="DisplayModeDropdown" 
    runat="server"  
    AutoPostBack="true" 
    Width="120"
    OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
  </asp:Panel>
</div>
<%@ control language="vb" classname="DisplayModeMenuVB"%>

<script runat="server">
  
' Use a field to reference the current WebPartManager.
Dim _manager As WebPartManager


Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) 
    AddHandler Page.InitComplete, AddressOf InitComplete

End Sub 


Sub InitComplete(ByVal sender As Object, ByVal e As System.EventArgs) 
    _manager = WebPartManager.GetCurrentWebPartManager(Page)
    
    Dim browseModeName As String = _
      WebPartManager.BrowseDisplayMode.Name
    
    ' Fill the dropdown with the names of supported display modes.
    Dim mode As WebPartDisplayMode
    For Each mode In  _manager.SupportedDisplayModes
        Dim modeName As String = mode.Name
        ' Make sure a mode is enabled before adding it.
        If mode.IsEnabled(_manager) Then
        Dim item As New ListItem(modeName, modeName)
            DisplayModeDropdown.Items.Add(item)
        End If
    Next mode

End Sub 
 

' Change the page to the selected display mode.
  Sub DisplayModeDropdown_SelectedIndexChanged(ByVal sender As Object, _
    ByVal e As EventArgs)
    Dim selectedMode As String = DisplayModeDropdown.SelectedValue
    
    Dim mode As WebPartDisplayMode = _
      _manager.SupportedDisplayModes(selectedMode)
    If Not (mode Is Nothing) Then
      _manager.DisplayMode = mode
    End If
 
  End Sub


Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs) 
    DisplayModeDropdown.SelectedValue = _manager.DisplayMode.Name

End Sub 

</script>
<div>
  <asp:Panel ID="Panel1" runat="server" 
    Borderwidth="1" 
    Width="125" 
    BackColor="lightgray"
    Font-Names="Verdana, Arial, Sans Serif" >
  <asp:Label ID="Label1" runat="server" 
    Text="&nbsp;Display Mode" 
    Font-Bold="true"
    Font-Size="8"
    Width="120" 
    AssociatedControlID="DisplayModeDropdown"/>
  <asp:DropDownList ID="DisplayModeDropdown" 
    runat="server"  
    AutoPostBack="true" 
    Width="120"
    OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
  </asp:Panel>
</div>

此代码示例的第二部分是TextDisplayWebPart控件。The second part of the code example is the TextDisplayWebPart control. 要使代码示例运行, 必须编译此源代码。For the code example to run, you must compile this source code. 可以显式编译该程序集, 并将生成的程序集放在网站的 Bin 文件夹或全局程序集缓存中。You can compile it explicitly and put the resulting assembly in your Web site's Bin folder or the global assembly cache. 或者, 你可以将源代码放在站点的 App_Code 文件夹中, 在此文件夹中, 它将在运行时动态编译。Alternatively, you can put the source code in your site's App_Code folder, where it will be dynamically compiled at run time. 有关演示两种编译方法的演练, 请参阅演练:开发和使用自定义 Web 服务器控件For a walkthrough that demonstrates both methods of compiling, see Walkthrough: Developing and Using a Custom Web Server Control.

请注意, 控件有一个名ContentText为的属性; 此属性保存用户在文本框中输入的值。Note that the control has a property named ContentText; this property holds the value that the user enters in the text box. 当控件处于编辑模式时, 可编辑此自定义属性以及标准WebPart控件属性。This custom property can be edited when the control is in edit mode, along with the standard WebPart control properties.

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace Samples.AspNet.CS.Controls
{
  [AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
  public class TextDisplayWebPart : WebPart
  {
    private String _contentText = null;
    TextBox input;
    Label DisplayContent;
    Literal lineBreak;

    [Personalizable(), WebBrowsable]
    public String ContentText
    {
      get { return _contentText; }
      set { _contentText = value; }
    }

    protected override void CreateChildControls()
    {
      Controls.Clear();
      DisplayContent = new Label();
      DisplayContent.BackColor = Color.LightBlue;
      DisplayContent.Text = this.ContentText;
      this.Controls.Add(DisplayContent);

      lineBreak = new Literal();
      lineBreak.Text = @"<br />";
      Controls.Add(lineBreak);

      input = new TextBox();
      this.Controls.Add(input);
      Button update = new Button();
      update.Text = "Set Label Content";
      update.Click += new EventHandler(this.submit_Click);
      this.Controls.Add(update);

    }

    private void submit_Click(object sender, EventArgs e)
    {
      // Update the label string.
      if (!string.IsNullOrEmpty(input.Text))
      {
        _contentText = input.Text + @"<br />";
        input.Text = String.Empty;
        DisplayContent.Text = this.ContentText;
      }
    }

  }
}
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts

Namespace Samples.AspNet.VB.Controls

  <AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
  Public Class TextDisplayWebPart
    Inherits WebPart
    Private _contentText As String = Nothing
    Private _fontStyle As String = Nothing
    Private input As TextBox
    Private DisplayContent As Label
    Private lineBreak As Literal

    <Personalizable(), WebBrowsable()> _
    Public Property ContentText() As String
      Get
        Return _contentText
      End Get
      Set(ByVal value As String)
        _contentText = value
      End Set
    End Property

    Protected Overrides Sub CreateChildControls()
      Controls.Clear()
      DisplayContent = New Label()
      DisplayContent.BackColor = Color.LightBlue
      DisplayContent.Text = Me.ContentText
      Me.Controls.Add(DisplayContent)

      lineBreak = New Literal()
      lineBreak.Text = "<br />"
      Controls.Add(lineBreak)

      input = New TextBox()
      Me.Controls.Add(input)
      Dim update As New Button()
      update.Text = "Set Label Content"
      AddHandler update.Click, AddressOf Me.submit_Click
      Me.Controls.Add(update)

    End Sub

    Private Sub submit_Click(ByVal sender As Object, _
                             ByVal e As EventArgs)
      ' Update the label string.
      If input.Text <> String.Empty Then
        _contentText = input.Text + "<br />"
        input.Text = String.Empty
        DisplayContent.Text = Me.ContentText
      End If

    End Sub

  End Class

End Namespace

此代码示例的第三部分是网页。The third part of the code example is the Web page. 请注意, <asp:editorzone>页面的元素包含三个EditorPart控件的声明。Notice that the <asp:editorzone> element for the page contains declarations for three EditorPart controls. 其中两个控件成为在执行EditorPartCollection Button1_Click方法时创建的自定义对象的一部分。Two of these controls become part of a custom EditorPartCollection object that is created when the Button1_Click method executes.

<%@ page language="c#" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenu" 
  Src="DisplayModecs.ascx" %>
<%@ register tagprefix="aspSample" 
  Namespace="Samples.AspNet.CS.Controls" 
  Assembly="TextDisplayWebPartCS" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  protected void Button1_Click(object sender, EventArgs e)
  {
    ArrayList list = new ArrayList(2);
    list.Add(AppearanceEditorPart1);
    list.Add(PropertyGridEditorPart1);
    // Pass an ICollection object to the constructor.
    EditorPartCollection myParts = new EditorPartCollection(list);
    foreach (EditorPart editor in myParts)
    {
      editor.BackColor = System.Drawing.Color.LightBlue;
      editor.Description = "My " + editor.DisplayTitle + " editor.";
    }

    // Use the IndexOf property to locate an EditorPart control.
    int propertyGridPart = myParts.IndexOf(PropertyGridEditorPart1);
    myParts[propertyGridPart].ChromeType = PartChromeType.TitleOnly;

    // Use the Contains method to see if an EditorPart exists.
    if(!myParts.Contains(LayoutEditorPart1))
      LayoutEditorPart1.BackColor = System.Drawing.Color.LightYellow;
    
    // Use the CopyTo method to create an array of EditorParts.
    EditorPart[] partArray = new EditorPart[3];
    partArray[0] = LayoutEditorPart1;
    myParts.CopyTo(partArray,1);
    Label1.Text = "<h3>EditorParts in Custom Array</h3>";
    foreach (EditorPart ePart in partArray)
    {
      Label1.Text += ePart.Title + "<br />";
    }

  }

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head id="Head1" runat="server">
    <title>
      Text Display WebPart with AppearanceEditorPart
    </title>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server" />
      <uc1:DisplayModeMenu ID="DisplayModeMenu1" runat="server" />
      <asp:webpartzone id="zone1" runat="server">
        <zonetemplate>
          <aspSample:TextDisplayWebPart 
            runat="server"   
            id="textwebpart" 
            title = "Text Content WebPart" />          
        </zonetemplate>
      </asp:webpartzone> 
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:AppearanceEditorPart ID="AppearanceEditorPart1" 
            runat="server" />
          <asp:LayoutEditorPart ID="LayoutEditorPart1" 
            runat="server" />
          <asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" 
            runat="server" />
        </ZoneTemplate>      
      </asp:EditorZone>
      <asp:Button ID="Button1" runat="server" 
        Text="Create EditorPartCollection" 
        OnClick="Button1_Click" />
      <asp:Label ID="Label1" runat="server" Text="" />
    </form>
  </body>
</html>
<%@ page language="vb" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenu" 
  Src="DisplayModevb.ascx" %>
<%@ register tagprefix="aspSample" 
  Namespace="Samples.AspNet.VB.Controls" 
  Assembly="TextDisplayWebPartVB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  Protected Sub Button1_Click(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    Dim list As New ArrayList(2)
    list.Add(AppearanceEditorPart1)
    list.Add(PropertyGridEditorPart1)
    ' Pass an ICollection object to the constructor.
    Dim myParts As New EditorPartCollection(list)
    Dim editor As EditorPart
    For Each editor In myParts
      editor.BackColor = System.Drawing.Color.LightBlue
      editor.Description = "My " + editor.DisplayTitle + " editor."
    Next editor
    
    ' Use the IndexOf property to locate an EditorPart control.
    Dim propertyGridPart As Integer = _
      myParts.IndexOf(PropertyGridEditorPart1)
    myParts(propertyGridPart).ChromeType = PartChromeType.TitleOnly
    
    ' Use the Contains method to see if an EditorPart exists.
    If Not myParts.Contains(LayoutEditorPart1) Then
      LayoutEditorPart1.BackColor = System.Drawing.Color.LightYellow
    End If
    
    ' Use the CopyTo method to create an array of EditorParts.
    Dim partArray(2) As EditorPart
    partArray(0) = LayoutEditorPart1
    myParts.CopyTo(partArray, 1)
    Label1.Text = "<h3>EditorParts in Custom Array</h3>"
    Dim ePart As EditorPart
    For Each ePart In partArray
      Label1.Text += ePart.Title + "<br />"
    Next ePart

  End Sub

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head id="Head1" runat="server">
    <title>
      Text Display WebPart with AppearanceEditorPart
    </title>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server" />
      <uc1:DisplayModeMenu ID="DisplayModeMenu1" runat="server" />
      <asp:webpartzone id="zone1" runat="server">
        <zonetemplate>
          <aspSample:TextDisplayWebPart 
            runat="server"   
            id="textwebpart" 
            title = "Text Content WebPart" />          
        </zonetemplate>
      </asp:webpartzone> 
      <asp:EditorZone ID="EditorZone1" runat="server">
        <ZoneTemplate>
          <asp:AppearanceEditorPart ID="AppearanceEditorPart1" 
            runat="server" />
          <asp:LayoutEditorPart ID="LayoutEditorPart1" 
            runat="server" />
          <asp:PropertyGridEditorPart ID="PropertyGridEditorPart1" 
            runat="server" />
        </ZoneTemplate>      
      </asp:EditorZone>
      <asp:Button ID="Button1" runat="server" 
        Text="Create EditorPartCollection" 
        OnClick="Button1_Click" />
      <asp:Label ID="Label1" runat="server" Text="" />
    </form>
  </body>
</html>

当你在浏览器中加载页面时, 可以通过在 "显示模式" 下拉列表控件中选择 "编辑", 将页面切换到编辑模式。When you load the page in a browser, you can switch the page into edit mode by selecting Edit in the Display Mode drop-down list control. 可以单击TextDisplayWebPart控件标题栏中的谓词菜单 (向下箭头), 然后单击 "编辑" 以编辑控件。You can click the verbs menu (the downward arrow) in the title bar of the TextDisplayWebPart control, and click Edit to edit the control. 编辑用户界面 (UI) 可见时, 可以看到所有EditorPart控件。When the editing user interface (UI) is visible, you can see all the EditorPart controls. 单击 "创建 EditorPartCollection " 按钮, 可以查看由处理EditorPart EditorPartCollection对象的代码所创建的控件的效果。You click the Create EditorPartCollection button to see the effects on the EditorPart controls that are created by the code that is manipulating the EditorPartCollection object. 另请注意PropertyGridEditorPart , 控件允许编辑自定义TextDisplayWebPart.ContentText属性。Also, notice that the PropertyGridEditorPart control allows you to edit the custom TextDisplayWebPart.ContentText property. 这是可能的, 因为属性是在控件WebBrowsable的源代码中用特性标记的。This is possible because the property is marked with a WebBrowsable attribute in the source code for the control. 如果在编辑 UI 中更新属性值, 则必须将页面恢复到正常浏览模式, 才能查看更新TextDisplayWebPart.ContentText属性的效果。If you update the property value in the editing UI, you must return the page to normal browse mode to see the effect of updating the TextDisplayWebPart.ContentText property.

注解

类是EditorPart控件的只读集合EditorZoneBase , 通常由区域用于跟踪区域包含的EditorPart控件集。 EditorPartCollectionThe EditorPartCollection class is a read-only collection of EditorPart controls, typically used by an EditorZoneBase zone to track the set of EditorPart controls contained by the zone.

当 Web 部件页面进入编辑模式, 并且用户选择要编辑的控件时, 将开始编辑过程。When a Web Parts page enters edit mode, and a user selects a control to edit, the editing process begins. 区域创建一个新EditorPartCollection的对象, 该EditorPart对象包含区域包含的控件。The zone creates a new EditorPartCollection object consisting of the EditorPart controls contained by the zone. 在编辑过程中的各个阶段, 区域访问EditorPartCollection对象以保存或检索集合中的EditorPart控件和当前正在编辑的WebPart控件之间的属性值。At various phases in the editing process, the zone accesses the EditorPartCollection object to save or retrieve property values between the EditorPart controls in the collection and the WebPart control currently being edited.

例如, 如果需要EditorPartCollection对一EditorPart组控件执行一些大容量操作, 则可以为自己的编程使用创建控件的集合。You can create an EditorPartCollection collection of controls for your own programmatic use if, for example, you need to perform some mass operation on a set of EditorPart controls. EditorPartCollection即使对象是只读的, 你也可以对集合中引用的基础控件的属性进行编程更改。Even though the EditorPartCollection object is read-only, you can make programmatic changes to the properties of the underlying controls referenced in the collection.

构造函数

EditorPartCollection() EditorPartCollection() EditorPartCollection() EditorPartCollection()

初始化 EditorPartCollection 类的空的新实例。Initializes an empty new instance of the EditorPartCollection class.

EditorPartCollection(EditorPartCollection, ICollection) EditorPartCollection(EditorPartCollection, ICollection) EditorPartCollection(EditorPartCollection, ICollection) EditorPartCollection(EditorPartCollection, ICollection)

通过传入 EditorPartCollection 控件的 EditorPartCollection 集合和其他 EditorPart 控件的 ICollection 集合,初始化 EditorPart 类的新实例。Initializes a new instance of the EditorPartCollection class by passing in an EditorPartCollection collection of EditorPart controls, and an ICollection collection of additional EditorPart controls.

EditorPartCollection(ICollection) EditorPartCollection(ICollection) EditorPartCollection(ICollection) EditorPartCollection(ICollection)

通过传入 EditorPartCollection 控件的 ICollection 集合,初始化 EditorPart 类的新实例。Initializes a new instance of the EditorPartCollection class by passing in an ICollection collection of EditorPart controls.

字段

Empty Empty Empty Empty

引用集合的一个空的静态只读实例。References a static, read-only, empty instance of the collection.

属性

Count Count Count Count

获取包含在 ReadOnlyCollectionBase 实例中的元素数。Gets the number of elements contained in the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示对 ReadOnlyCollectionBase 对象的访问是否同步(线程安全)。Gets a value indicating whether access to a ReadOnlyCollectionBase object is synchronized (thread safe).

(Inherited from ReadOnlyCollectionBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取一个对象,该对象可用于同步对 ReadOnlyCollectionBase 对象的访问。Gets an object that can be used to synchronize access to a ReadOnlyCollectionBase object.

(Inherited from ReadOnlyCollectionBase)
InnerList InnerList InnerList InnerList

获取 ReadOnlyCollectionBase 实例中包含的元素的列表。Gets the list of elements contained in the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

根据唯一标识符返回集合中的特定成员。Returns a specific member of the collection according to a unique identifier.

方法

Contains(EditorPart) Contains(EditorPart) Contains(EditorPart) Contains(EditorPart)

返回一个值,该值指示集合中是否存在特定控件。Returns a value that indicates whether a particular control is in the collection.

CopyTo(EditorPart[], Int32) CopyTo(EditorPart[], Int32) CopyTo(EditorPart[], Int32) CopyTo(EditorPart[], Int32)

将集合复制到 EditorPart 控件的数组。Copies the collection to an array of EditorPart controls.

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()

返回循环访问 ReadOnlyCollectionBase 实例的枚举器。Returns an enumerator that iterates through the ReadOnlyCollectionBase instance.

(Inherited from ReadOnlyCollectionBase)
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(EditorPart) IndexOf(EditorPart) IndexOf(EditorPart) IndexOf(EditorPart)

返回集合中特定成员的位置。Returns the position of a particular member of the collection.

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

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

(Inherited from Object)
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)

从目标数组的指定索引处开始将整个 ReadOnlyCollectionBase 复制到兼容的一维 ArrayCopies the entire ReadOnlyCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Inherited from ReadOnlyCollectionBase)

扩展方法

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.

适用于

另请参阅