SolutionObject 接口

定义

对应于 InfoPath 表单模板。

public interface class SolutionObject : Microsoft::Office::Interop::InfoPath::SemiTrust::Solution
[System.Runtime.InteropServices.Guid("096cd557-0786-11d1-95fa-0080c78ee3bb")]
public interface SolutionObject : Microsoft.Office.Interop.InfoPath.SemiTrust.Solution
type SolutionObject = interface
    interface Solution
Public Interface SolutionObject
Implements Solution
属性
实现

示例

在以下示例中,将引用设置为 Solution 对象,然后代码使用 DOMSolution 对象的 属性从 .xsf 获取创作表单的人员的姓名。 然后进行测试,以确定是否有作者的值,并在消息框中显示结果。

[InfoPathEventHandler(MatchPath="SolutionInfo", EventType=InfoPathEventType.OnClick)]
public void SolutionInfo_OnClick(DocActionEvent e)
{
<span class="label">Solution</span> solution = thisXDocument.<span class="label">Solution</span>;
 string solutionVersion = solution.Version;
 string authorText;
 IXMLDOMNode author = solution.DOM.selectSingleNode("xsf:xDocumentClass/@author");

 if (author != null)
 {
  authorText = author.text;
 }
 else
 {
  authorText = "Author not available.";
 }

 thisXDocument.UI.Alert("Version: " + solutionVersion + "\nAuthor: " + authorText);
}

注解

此类型是用于 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)的包装。 使用此类型来访问由此 Coclass 实现的 COM 接口。 有关 COM 接口的信息(包括指向其成员说明的链接),请参阅Solution

通过使用 Solution 接口成员,将可与 InfoPath 2003 兼容。 若要使用在 InfoPath 2010 中添加到 Solution2 对象模型的新成员,必须将 对象的 属性返回 Solution 的对象 XDocument 强制转换为 Solution2 类型。 有关详细信息,请参阅如何:使用与 InfoPath 2003 不兼容的对象模型成员。

SolutionObject 对象实现的属性用以获得表单模板的信息,包括版本号、已提取表单文件的统一资源定位器 (URL)、模板加载来源的 URL 以及包含表单定义文件 (.xsf) 的 XML 文档对象模型 (DOM)。

通过 对象的 属性XDocument访问 SolutionSolutionObject 对象。

属性

DOM

获取一个对 XML 文档对象模型 (DOM) 的引用,该模型中包含表单定义 (.xsf) 文件的源 XML。

(继承自 Solution)
PackageURL

获取缓存文件夹的统一资源定位器 (URL),该缓存文件夹包含 Microsoft Office InfoPath 2003 表单的已提取的表单文件。

(继承自 Solution)
URI

获取 Microsoft Office InfoPath 2003 表单模板的统一资源标识符 (URI)。

(继承自 Solution)
Version

获取表单模板的版本号。

(继承自 Solution)

适用于