Export (0) Print
Expand All

SPFile.CustomizedPageStatus property

Gets the customization (also known as "ghost") status of the file object.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPCustomizedPageStatus CustomizedPageStatus { get; }

Property value

Type: Microsoft.SharePoint.SPCustomizedPageStatus
The customized status.

The following example shows how to discover the customized status of master pages for a Web site.

using System;
using Microsoft.SharePoint;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://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();
        }
    }
}
Show:
© 2014 Microsoft