XML ファイルへの接続を表します。
名前空間: Microsoft.Office.Interop.InfoPath.SemiTrust
アセンブリ: Microsoft.Office.Interop.InfoPath.SemiTrust (microsoft.office.interop.infopath.semitrust.dll 内)
構文
'宣言
<GuidAttribute("096cd5d5-0786-11d1-95fa-0080c78ee3bb")> _
<CLSCompliantAttribute(False)> _
<CoClassAttribute(GetType(XMLFileAdapterObjectWrapper))> _
Public Interface XMLFileAdapterObject
Inherits XMLFileAdapter2, XMLFileAdapter
'使用
Dim instance As XMLFileAdapterObject
[GuidAttribute("096cd5d5-0786-11d1-95fa-0080c78ee3bb")]
[CLSCompliantAttribute(false)]
[CoClassAttribute(typeof(XMLFileAdapterObjectWrapper))]
public interface XMLFileAdapterObject : XMLFileAdapter2, XMLFileAdapter
コメント
この型は、COM 相互運用のためにマネージ コードで必要とされるコクラスのラッパーです。この型を使用して、このコクラスによって実装される COM インターフェイスのメンバにアクセスします。COM インターフェイスについては (このメンバの説明へのリンクを含む)、次を参照してください XMLFileAdapter2。
XMLFileAdapterObject オブジェクトは、Microsoft Office InfoPath 2007 データ アダプタの種類の 1 つで、外部データ ソースからデータを取得するために必要なすべての情報を含んでいます。
XMLFileAdapterObject オブジェクトには FileURL プロパティがあり、このプロパティを使用すると、外部データ ソースとして使用されている XML ファイルの URL (Uniform Resource Locator) を取得または設定することができます。
セカンダリ データ ソースの場合、XMLFileAdapterObject オブジェクトには、DataSourceObject の QueryAdapter プロパティ 、および DataAdaptersCollection コレクションの Item プロパティを使用してアクセスします。
DataObject オブジェクトには、XDocument オブジェクトの DataObjects プロパティを使用してアクセスします。
例
DataAdapters dtaAdapters;
dataAdapters = thisDocument.DataAdapters;
XMLFileAdapterObject queryXMLFile = dataAdapters["form1"] as XMLFileAdapterObject;
if (queryXMLFile == null)
{
thisXDocument.UI.Alert("The DataAdapter does not exist or is not an XMLFileAdapterObject.");
}
else
{
thisDocument.UI.Alert("Query - XML file adapter");
thisDocument.UI.Alert("Name: " + queryXMLFile.Name);
thisDocument.UI.Alert("QueryAllowed: " + queryXMLFile.QueryAllowed);
thisDocument.UI.Alert("SubmitAllowed: " + queryXMLFile.SubmitAllowed);
thisDocument.UI.Alert("FileURL: " + queryXMLFile.FileURL);
// Perform the query.
try
{
queryXMLFile.Query();
}
catch (Exception ex)
{
thisXDocument.UI.Alert("Failed to query.\n\n" + ex.Message);
}
// Perform the submit.
try
{
queryXMLFile.Submit();
}
catch (Exception ex)
{
thisXDocument.UI.Alert("Failed to submit.\n\n" + ex.Message);
}
}
関連項目
参照
XMLFileAdapterObject のメンバ
Microsoft.Office.Interop.InfoPath.SemiTrust 名前空間