SPFile.CustomizedPageStatus-Eigenschaft
Ruft das Anpassung (auch "Ghost") für das File-Objekt ab.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public ReadOnly Property CustomizedPageStatus As SPCustomizedPageStatus
Get
'Usage
Dim instance As SPFile
Dim value As SPCustomizedPageStatus
value = instance.CustomizedPageStatus
public SPCustomizedPageStatus CustomizedPageStatus { get; }
Eigenschaftswert
Typ: Microsoft.SharePoint.SPCustomizedPageStatus
Der benutzerdefinierte Status.
Beispiele
Im folgende Beispiel wird veranschaulicht, wie Sie den benutzerdefinierten Status von Masterseiten für eine Website zu ermitteln.
using System;
using Microsoft.SharePoint;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("https://localhost"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.GetCatalog(SPListTemplateType.MasterPageCatalog);
if (list != null)
{
foreach (SPListItem item in list.Items)
{
if (item.File != null)
{
Console.WriteLine("Filename: {0, -20} Status: {1}",
item.File.Name, item.File.CustomizedPageStatus);
}
}
}
}
}
Console.Write("\nPress ENTER to continue....");
Console.ReadLine();
}
}
}
Imports System
Imports Microsoft.SharePoint
Module ConsoleApp
Sub Main()
Using site As New SPSite("https://localhost")
Using web As SPWeb = site.OpenWeb()
Dim list As SPList = web.GetCatalog(SPListTemplateType.MasterPageCatalog)
If list IsNot Nothing Then
For Each item As SPListItem In list.Items
If item.File IsNot Nothing Then
Console.WriteLine("Filename: {0, -20} Status: {1}", _
item.File.Name, item.File.CustomizedPageStatus)
End If
Next
End If
End Using
End Using
Console.Write(vbCrLf & "Press ENTER to continue....")
Console.Read()
End Sub
End Module