CatalogPartCollection CatalogPartCollection CatalogPartCollection CatalogPartCollection Class

定义

包含 CatalogPart 控件的集合,这些控件用于提供最终用户可添加到网页的 Web 服务器控件目录。Contains a collection of CatalogPart controls used to provide catalogs of Web server controls that end users can add to a Web page. 此类不能被继承。This class cannot be inherited.

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

示例

下面的代码示例演示了CatalogPartCollection类的几个用途。The following code example demonstrates several uses of the CatalogPartCollection 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为的自定义控件的类, 该控件在网页中引用, 并CatalogPart包含在一个控件中。A class for a custom WebPart control named TextDisplayWebPart, which is referenced in the Web page and is contained in one of the CatalogPart controls.

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

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

此代码示例的第一部分是用户控件。The first part of the code example is the user control. 该用户控件的源代码来自其他主题。The source code for the user control comes from another topic. 要使此代码示例正常运行, 需要从演练中获取用户控件的 .ascx 文件:更改 Web 部件页面主题的显示模式, 并将该文件放在此代码示例中 .aspx 页面所在的同一文件夹中。For this code example to work, you need to obtain the .ascx file for the user control from the Walkthrough: Changing Display Modes on a Web Parts Page topic, and place the file in the same folder as the .aspx page in this code example.

此代码示例的第二部分是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.

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:catalogzone>页面的元素包含两个CatalogPart控件的声明。Notice that the <asp:catalogzone> element for the page contains declarations for two CatalogPart controls. 这些控件将成为执行CatalogPartCollection Button1_Click方法时创建的自定义对象的一部分。These controls become part of a custom CatalogPartCollection object that is created when the Button1_Click method executes. PageCatalogPart控件包含之前已由用户关闭的 Web 服务器控件。The PageCatalogPart control contains Web server controls that have been previously closed by a user at run time. 控件中的PageCatalogPart控件可以添加回页面。Controls in the PageCatalogPart control can be added back to a page. 控件包含自定义TextDisplayWebPart控件的声明。 DeclarativeCatalogPartThe DeclarativeCatalogPart control contains a declaration of the custom TextDisplayWebPart control. 当页处于目录模式时, 用户可以将该TextDisplayWebPart控件添加到页面中, 以便可以在正常浏览模式下使用该控件。When the page is in catalog mode, a user can add the TextDisplayWebPart control to the page so that it can be used in normal browse mode.

<%@ Page Language="C#" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuCS" 
  Src="DisplayModeMenuCS.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">
  // <snippet2>
  protected void Button1_Click(object sender, EventArgs e)
  {
    ArrayList list = new ArrayList(2);
    list.Add(PageCatalogPart1);
    list.Add(DeclarativeCatalogPart1);
    // Pass an ICollection object to the constructor.
    CatalogPartCollection myParts = new CatalogPartCollection(list);
    foreach (CatalogPart catalog in myParts)
    {
      catalog.Description = "My " + catalog.DisplayTitle;
    }

    // Use the IndexOf property to locate a CatalogPart control.
    int PageCatalogPartIndex = myParts.IndexOf(PageCatalogPart1);
    myParts[PageCatalogPartIndex].ChromeType = PartChromeType.TitleOnly;

    // Use the Contains method to see if a CatalogPart control exists.
    if (myParts.Contains(PageCatalogPart1))
    {
      WebPart closedWebPart = null;
      WebPartDescriptionCollection descriptions = PageCatalogPart1.GetAvailableWebPartDescriptions();
      if (descriptions.Count > 0)
      {
        closedWebPart = PageCatalogPart1.GetWebPart(descriptions[0]);
        closedWebPart.AllowClose = false;
      }
    }
    
    // Use indexers to display the details of the CatalogPart controls.
    Label1.Text = String.Empty;
    Label1.Text =
      "<h3>PageCatalogPart Details</h3>" +
      "ID: " + myParts[0].ID + "<br />" +
      "Count: " + myParts[0].GetAvailableWebPartDescriptions().Count;
    Label1.Text += 
      "<h3>DeclarativeCatalogPart Details</h3>" +
      "ID: " + myParts["DeclarativeCatalogPart1"].ID + "<br />" +
      "Count: " + myParts["DeclarativeCatalogPart1"].GetAvailableWebPartDescriptions().Count;
  }
  // </snippet2>
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>PageCatalogPart Details</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server" />
    <uc1:DisplayModeMenuCS ID="DisplayModeMenu1" runat="server" />
    <asp:WebPartZone ID="WebPartZone1" runat="server">
      <ZoneTemplate>
        <asp:BulletedList 
          ID="BulletedList1" 
          Runat="server"
          DisplayMode="HyperLink" 
          Title="Favorite Links" >
          <asp:ListItem Value="http://msdn.microsoft.com">
            MSDN
          </asp:ListItem>
          <asp:ListItem Value="http://www.asp.net">
            ASP.NET
          </asp:ListItem>
          <asp:ListItem Value="http://www.msn.com">
            MSN
          </asp:ListItem>
        </asp:BulletedList>
      </ZoneTemplate>
    </asp:WebPartZone>
    <asp:CatalogZone ID="CatalogZone1" runat="server">
      <ZoneTemplate>
        <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server">
          <WebPartsTemplate>
            <aspSample:TextDisplayWebPart runat="server" 
              id="TextDisplayWebPart1"
              Title="Text Display WebPart" />
          </WebPartsTemplate>
        </asp:DeclarativeCatalogPart>
        <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />  
      </ZoneTemplate>
    </asp:CatalogZone>
    <hr />
    <asp:Button ID="Button1" 
      runat="server" 
      Text="Display CatalogPart Properties" 
      OnClick="Button1_Click"/>
    <br />
    <asp:Label ID="Label1" runat="server" Text="" /> 
  </form>
</body>
</html>
<%@ Page Language="vb" %>
<%@ register TagPrefix="uc1" 
  TagName="DisplayModeMenuVB" 
  Src="DisplayModeMenuVB.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">
' <snippet2>
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) 
    Dim list As New ArrayList(2)
    list.Add(PageCatalogPart1)
    list.Add(DeclarativeCatalogPart1)
    ' Pass an ICollection object to the constructor.
    Dim myParts As New CatalogPartCollection(list)
    Dim catalog As CatalogPart
    For Each catalog In  myParts
        catalog.Description = "My " + catalog.DisplayTitle
    Next catalog
    
    ' Use the IndexOf property to locate a CatalogPart control.
    Dim PageCatalogPartIndex As Integer = _
      myParts.IndexOf(PageCatalogPart1)
    myParts(PageCatalogPartIndex).ChromeType = PartChromeType.TitleOnly
    
    ' Use the Contains method to see if a CatalogPart control exists.
    If myParts.Contains(PageCatalogPart1) Then
        Dim closedWebPart As WebPart = Nothing
        Dim descriptions As WebPartDescriptionCollection = _
          PageCatalogPart1.GetAvailableWebPartDescriptions()
        If descriptions.Count > 0 Then
            closedWebPart = PageCatalogPart1.GetWebPart(descriptions(0))
            closedWebPart.AllowClose = False
        End If
    End If
    
    ' Use indexers to display the details of the CatalogPart controls.
    Label1.Text = String.Empty
    Label1.Text = _
      "<h3>PageCatalogPart Details</h3>" & _
      "ID: " & myParts(0).ID + "<br />" & _
      "Count: " & myParts(0).GetAvailableWebPartDescriptions().Count
    Label1.Text += _
      "<h3>DeclarativeCatalogPart Details</h3>" & _
      "ID: " & myParts("DeclarativeCatalogPart1").ID & "<br />" & _
      "Count: " & myParts("DeclarativeCatalogPart1") _
        .GetAvailableWebPartDescriptions().Count

End Sub 
' </snippet2>
</script>  
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>PageCatalogPart Details</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server" />
    <uc1:DisplayModeMenuVB ID="DisplayModeMenu1" runat="server" />
    <asp:WebPartZone ID="WebPartZone1" runat="server">
      <ZoneTemplate>
        <asp:BulletedList 
          ID="BulletedList1" 
          Runat="server"
          DisplayMode="HyperLink" 
          Title="Favorite Links" >
          <asp:ListItem Value="http://msdn.microsoft.com">
            MSDN
          </asp:ListItem>
          <asp:ListItem Value="http://www.asp.net">
            ASP.NET
          </asp:ListItem>
          <asp:ListItem Value="http://www.msn.com">
            MSN
          </asp:ListItem>
        </asp:BulletedList>
      </ZoneTemplate>
    </asp:WebPartZone>
    <asp:CatalogZone ID="CatalogZone1" runat="server">
      <ZoneTemplate>
        <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server">
          <WebPartsTemplate>
            <aspSample:TextDisplayWebPart runat="server" 
              id="TextDisplayWebPart1"
              Title="Text Display WebPart" />
          </WebPartsTemplate>
        </asp:DeclarativeCatalogPart>
        <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />  
      </ZoneTemplate>
    </asp:CatalogZone>
    <hr />
    <asp:Button ID="Button1" 
      runat="server" 
      Text="Display CatalogPart Properties" 
      OnClick="Button1_Click"/>
    <br />
    <asp:Label ID="Label1" runat="server" Text="" /> 
  </form>
</body>
</html>

在浏览器中加载页面时, 可以通过在 "显示模式" 下拉列表控件中选择 "目录", 将页面切换到目录模式。When you load the page in a browser, you can switch the page into catalog mode by selecting Catalog in the Display Mode drop-down list control. 您可以通过选中控件WebPart旁边的复选框并单击 "添加", 将该自定义控件添加到该页。You can add the custom WebPart control to the page by selecting the check box next to it and clicking Add. 单击 "关闭" 可将该页返回到浏览模式。Click Close to return the page to browse mode. 在刚添加的控件上, 如果单击谓词菜单 (显示在标题栏中的向下箭头), 然后单击 "关闭", 则将从页中移除控件并将其添加PageCatalogPart到控件中。On the control you just added, if you click the verbs menu (the down arrow that appears in the title bar) and then click Close, the control is removed from the page and added to the PageCatalogPart control. 将页面返回到目录模式, 然后单击 "目录" 链接以查看该PageCatalogPart控件的内容。Return the page to catalog mode, and click the Page Catalog link to view the contents of the PageCatalogPart control. 请注意, 您关闭的控件现在会显示在那里。Notice that the control you closed now appears there. 单击 "显示 CatalogPart 属性" 按钮将CatalogPartCollection访问对象并显示所包含CatalogPart控件的某些属性。Clicking the Display CatalogPart Properties button accesses the CatalogPartCollection object and displays certain properties of the contained CatalogPart controls.

注解

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

当 Web 部件页面进入目录模式时, 区域将创建由CatalogPartCollection CatalogPart控件组成的新对象。When a Web Parts page enters catalog mode, the zone creates a new CatalogPartCollection object consisting of the CatalogPart controls. 集合CatalogPart中的每个控件都可以包含对零个或多个 Web 服务器控件的引用, 这些控件以可用服务器控件目录的形式显示。Each CatalogPart control in the collection can contain references to zero or more Web server controls, which are displayed in the form of a catalog of available server controls.

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

构造函数

CatalogPartCollection() CatalogPartCollection() CatalogPartCollection() CatalogPartCollection()

初始化 CatalogPartCollection 类的新的空实例。Initializes a new, empty instance of the CatalogPartCollection class.

CatalogPartCollection(CatalogPartCollection, ICollection) CatalogPartCollection(CatalogPartCollection, ICollection) CatalogPartCollection(CatalogPartCollection, ICollection) CatalogPartCollection(CatalogPartCollection, ICollection)

通过传入某个区域中现有 CatalogPartCollection 控件的 ICollection 集合以及其他控件集合,初始化 CatalogPart 类的新实例。Initializes a new instance of the CatalogPartCollection class by passing in an ICollection collection of the existing CatalogPart controls in a zone, and an additional collection of controls.

CatalogPartCollection(ICollection) CatalogPartCollection(ICollection) CatalogPartCollection(ICollection) CatalogPartCollection(ICollection)

通过传入 CatalogPartCollection 控件的 ICollection 集合,初始化 CatalogPart 类的新实例。Initializes a new instance of the CatalogPartCollection class by passing in an ICollection collection of CatalogPart 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]

基于集合中的位置获取或设置集合的成员。Gets or sets a member of the collection, based on its position in the collection.

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

基于唯一字符串标识符返回集合的成员。Returns a member of the collection based on a unique string identifier.

方法

Contains(CatalogPart) Contains(CatalogPart) Contains(CatalogPart) Contains(CatalogPart)

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

CopyTo(CatalogPart[], Int32) CopyTo(CatalogPart[], Int32) CopyTo(CatalogPart[], Int32) CopyTo(CatalogPart[], Int32)

将集合复制到 CatalogPart 对象的数组。Copies the collection to an array of CatalogPart objects.

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

返回集合中特定成员的位置。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.

适用于

另请参阅