FormTemplateCollection-Klasse
Alle vom Administrator genehmigte Formularvorlagen auf der Serverfarm darstellt.
Vererbungshierarchie
System.Object
Microsoft.SharePoint.Administration.SPPersistedObjectCollection<FormTemplate>
Microsoft.SharePoint.Administration.SPPersistedChildCollection<FormTemplate>
Microsoft.Office.InfoPath.Server.Administration.FormTemplateCollection
Namespace: Microsoft.Office.InfoPath.Server.Administration
Assembly: Microsoft.Office.InfoPath.Server (in Microsoft.Office.InfoPath.Server.dll)
Syntax
'Declaration
<GuidAttribute("543DD7B9-6E48-438d-86D8-100000000000")> _
Public NotInheritable Class FormTemplateCollection _
Inherits SPPersistedChildCollection(Of FormTemplate) _
Implements IBackupRestoreConfiguration, IBackupRestore
'Usage
Dim instance As FormTemplateCollection
[GuidAttribute("543DD7B9-6E48-438d-86D8-100000000000")]
public sealed class FormTemplateCollection : SPPersistedChildCollection<FormTemplate>,
IBackupRestoreConfiguration, IBackupRestore
Hinweise
Benutzerformularvorlagen und die Bereitstellung von Inhaltstypen für Websitesammlungen in der FormTemplateCollection -Auflistung nicht aufgezählt werden. Vom Administrator genehmigte Formularvorlagen werden als Inhaltstypen bereitgestellt und in der Auflistung aufgelistet werden.
Beispiele
Die folgenden beiden Beispiele wird die Anzahl der vom Administrator genehmigten Formularvorlagen in die Konsole geschrieben. Verweise sind in der Visual Studio-Projekt auf die [Microsoft.Office.Server], **[Microsoft.Office.InfoPath.Server]**und [Microsoft.SharePoint] -Assemblys erforderlich.
Hinweis
Suchen Sie nach der Assembly [Microsoft.Office.InfoPath.Server]<drive>:\Program Files\Microsoft Office Servers\14.0\Bin.
Die folgenden import -Anweisungen sind erforderlich für die
Microsoft.Office.Server, Microsoft.Office.InfoPath.Server.Administrationund Microsoft.SharePoint.Administration -Namespace:
Dim LocalFormsService As FormsService
Dim LocalFarm As SPFarm
Dim FormTemps As Integer
Try
LocalFarm = SPFarm.Local
LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)
FormTemps = LocalFormsService.FormTemplates.Count()
Console.WriteLine("Number of form templates: " & FormTemps.ToString())
Console.Write("Press Enter to Continue")
Console.ReadLine()
Catch ex As Exception
Console.WriteLine("Error: " + ex.Message)
Console.Write("Press Enter to Continue")
Console.ReadLine()
End Try
Die folgenden using -Anweisungen sind erforderlich für die
Microsoft.Office.Server, Microsoft.Office.InfoPath.Server.Administrationund Microsoft.SharePoint.Administration -Namespaces.
FormsService localFormsService;
SPFarm localFarm = SPFarm.Local;
Int16 formTemps;
try
{
localFormsService = localFarm.Services.GetValue<FormsService>(FormsService.ServiceName);
formTemps = (Int16)localFormsService.FormTemplates.Count;
Console.WriteLine("Number of form templates: " + formTemps.ToString());
Console.Write("Press Enter to Continue");
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
Console.Write("Press Enter to Continue");
Console.ReadLine();
}
Threadsicherheit
Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Die Threadsicherheit von Instanzmembern ist nicht gewährleistet.