共用方式為


RibbonReadOnlyCollection 介面

可讓您存取功能區自訂中的 IRibbonExtension 物件。

命名空間:  Microsoft.Office.Tools.Ribbon
組件:  Microsoft.Office.Tools.Common (在 Microsoft.Office.Tools.Common.dll 中)

語法

'宣告
<GuidAttribute("c3b587bc-42bc-401b-a1e7-f85777d5156a")> _
Public Interface RibbonReadOnlyCollection _
    Inherits IList(Of IRibbonExtension), ICollection(Of IRibbonExtension),  _
    IEnumerable(Of IRibbonExtension), IEnumerable
[GuidAttribute("c3b587bc-42bc-401b-a1e7-f85777d5156a")]
public interface RibbonReadOnlyCollection : IList<IRibbonExtension>, 
    ICollection<IRibbonExtension>, IEnumerable<IRibbonExtension>, IEnumerable

RibbonReadOnlyCollection 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Count 取得在 ICollection<T> 中所包含的元素數。 (繼承自 ICollection<IRibbonExtension>)。
公用屬性 IsReadOnly 取得值,這個值表示 ICollection<T> 是否為唯讀。 (繼承自 ICollection<IRibbonExtension>)。
公用屬性 Item 取得或設定指定之索引處的項目。 (繼承自 IList<IRibbonExtension>)。

回頁首

方法

  名稱 說明
公用方法 Add 將項目加入至 ICollection<T> 中。 (繼承自 ICollection<IRibbonExtension>)。
公用方法 Clear 將所有項目從 ICollection<T> 移除。 (繼承自 ICollection<IRibbonExtension>)。
公用方法 Contains 判斷 ICollection<T> 是否包含特定值。 (繼承自 ICollection<IRibbonExtension>)。
公用方法 CopyTo 從特定的 Array 索引開始,複製 ICollection<T> 項目至 Array。 (繼承自 ICollection<IRibbonExtension>)。
公用方法 GetEnumerator() 傳回可逐一查看集合的列舉程式。 (繼承自 IEnumerable<IRibbonExtension>)。
公用方法 GetEnumerator() 傳回會逐一查看集合的列舉程式。 (繼承自 IEnumerable)。
公用方法 GetRibbon 基礎架構。傳回特定類型之 IRibbonExtension 的執行個體 (如果它存在於這個 RibbonReadOnlyCollection 中的話)。
公用方法 GetRibbonContextCollection 基礎架構。傳回與指定之訊息類別或應用程式關聯的 IRibbonExtension 物件集合。
公用方法 IndexOf 判斷 IList<T> 中特定項目的索引。 (繼承自 IList<IRibbonExtension>)。
公用方法 Insert 將項目插入位於指定索引的 IList<T>。 (繼承自 IList<IRibbonExtension>)。
公用方法 Remove ICollection<T> 移除特定物件之第一個符合的元素。 (繼承自 ICollection<IRibbonExtension>)。
公用方法 RemoveAt 移除指定之索引處的 IList<T> 項目。 (繼承自 IList<IRibbonExtension>)。

回頁首

備註

這個物件所表示的集合可以包含功能區自訂中任何類型的所有 IRibbonExtension 物件,也可以只包含特定訊息類別或 Microsoft Office 應用程式的 IRibbonExtension 物件。

當您將功能區加入至專案時,Visual Studio 就會在您的應用程式中加入 Globals 類別。 Globals 類別的 Ribbons 屬性會傳回衍生自 RibbonCollectionBase 類別的執行個體。 您可以使用 Globals.Ribbons 集合來存取與您的 Office 自訂相關聯的功能區。

注意事項注意事項

此介面是由 Visual Studio Tools for Office Runtime 所實作, 並不能實作於您的程式碼中。 如需詳細資訊,請參閱 Visual Studio Tools for Office Runtime 概觀

使用方式

本文件說明此型別用於以 .NET Framework 4 為目標之 Office 專案的版本。在以 .NET Framework 3.5 為目標的專案中,此型別可能會有不同的成員,而為此型別提供的程式碼範例可能無法運作。 如需此型別在以 .NET Framework 3.5 為目標之專案中的相關文件,請參閱下列 Visual Studio 2008 文件中的參考章節:https://go.microsoft.com/fwlink/?LinkId=160658 (英文)。

請參閱

參考

Microsoft.Office.Tools.Ribbon 命名空間

其他資源

在執行階段存取功能區

全域存取 Office 專案中的物件