SPFile.CustomizedPageStatus 属性
获取的文件对象的自定义项 (也称为"幻影") 状态。
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public ReadOnly Property CustomizedPageStatus As SPCustomizedPageStatus
Get
用法
Dim instance As SPFile
Dim value As SPCustomizedPageStatus
value = instance.CustomizedPageStatus
public SPCustomizedPageStatus CustomizedPageStatus { get; }
属性值
类型:Microsoft.SharePoint.SPCustomizedPageStatus
自定义的状态。
示例
下面的示例演示如何查找主页面的 Web 站点的自定义的状态。
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