Share via


Interfaz SolutionObject

Corresponde a una plantilla de formulario de InfoPath.

Espacio de nombres:  Microsoft.Office.Interop.InfoPath.SemiTrust
Ensamblado:  Microsoft.Office.Interop.InfoPath.SemiTrust (en Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Sintaxis

'Declaración
<GuidAttribute("096cd557-0786-11d1-95fa-0080c78ee3bb")> _
Public Interface SolutionObject _
    Inherits Solution
'Uso
Dim instance As SolutionObject
[GuidAttribute("096cd557-0786-11d1-95fa-0080c78ee3bb")]
public interface SolutionObject : Solution

Comentarios

Este tipo es un contenedor para una coclase que requiere el código administrado para la interoperabilidad con COM. Use este tipo para acceder a los miembros de la interfaz COM que implementa esta coclase. Encontrará información sobre la interfaz COM, así como vínculos a las descripciones de sus miembros, enSolution.

Using the members of the Solution interface provides compatibility with InfoPath 2003. To use new members that were added to the Solution2 object model in InfoPath 2010, you must cast the object returned by the Solution property of the XDocument object to the Solution2 type. For more information, see How to: Use Object Model Members That Are Not Compatible with InfoPath 2003.

El objeto SolutionObject implementa propiedades para obtener información sobre una plantilla de formulario, que incluye su número de versión, la dirección URL de sus archivos de formulario extraídos, la dirección URL desde la que se ha cargado y un modelo de objetos de documento (DOM) XML que contenga un archivo de definición de formulario (.xsf).

Se obtiene acceso al objeto SolutionObject por medio de la propiedad Solution del objeto XDocument.

Ejemplos

En el ejemplo siguiente, se establece una referencia al objeto Solution y, a continuación, el código obtiene del archivo .xsf el nombre de la persona que ha creado el formulario, por medio de la propiedad DOM del objeto Solution. Por último, se efectúa una prueba para determinar si se trata de un valor de autor y el resultado se muestra en un cuadro de mensaje.

[InfoPathEventHandler(MatchPath="SolutionInfo", EventType=InfoPathEventType.OnClick)]
public void SolutionInfo_OnClick(DocActionEvent e)
{
 Solution solution = thisXDocument.Solution;
 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);
}

Vea también

Referencia

Miembros SolutionObject

Espacio de nombres Microsoft.Office.Interop.InfoPath.SemiTrust