IRibbonExtensibility.GetCustomUI(String) 方法

定义

从 XML 自定义文件或过程中嵌入的 XML 标记加载 XML 标记,以自定义功能区用户界面。

public:
 System::String ^ GetCustomUI(System::String ^ RibbonID);
public string GetCustomUI (string RibbonID);
abstract member GetCustomUI : string -> string
Public Function GetCustomUI (RibbonID As String) As String

参数

RibbonID
String

返回

String

示例

在以下用 C# 编写的示例中,IRibbonExtensibility 接口是在类定义中指定的。 该示例随后将实现该接口的唯一方法 GetCustomUI。 该方法将创建 SteamReader 对象的实例,后者在外部 XML 文件的自定义标记中读取数据。

public class Connect : Object, Extensibility.IDTExtensibility2, IRibbonExtensibility 
... 

public string GetCustomUI(string RibbonID) 
{ 

   StreamReader customUIReader = new System.IO.StreamReader("C:\\RibbonXSampleCS\\customUI.xml"); 

   string customUIData = customUIReader.ReadToEnd(); 

   return customUIData; 
}

适用于