Compartilhar via


SPRegionalSettings.ShowWeeks property

Obtém ou define um valor Booliano que especifica se o número da semana é exibido no modo de exibição de dias ou semanas de um calendário.

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

Syntax

'Declaração
Public Property ShowWeeks As Boolean
    Get
    Set
'Uso
Dim instance As SPRegionalSettings
Dim value As Boolean

value = instance.ShowWeeks

instance.ShowWeeks = value
public bool ShowWeeks { get; set; }

Property value

Type: System.Boolean
true para exibir semanas no calendário; Caso contrário, false.

Examples

O exemplo de código a seguir define o tipo de calendário como gregoriano e habilita a exibição do número da semana.

Dim siteCollection As New SPSite("https://localhost")
Try
    Dim rootWebSite As SPWeb = siteCollection.RootWeb
    Dim regionalsettings As SPRegionalSettings = rootWebSite.RegionalSettings
    regionalsettings.CalendarType = 0
    regionalsettings.ShowWeeks = True

    rootWebSite.Update()
    rootWebSite.Dispose()
Finally
    siteCollection.Dispose()
End Try
using (SPSite oSiteCollection = new SPSite("https://localhost"))
{
    using (SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
    {
        SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings; 
        oRegionalSettings.CalendarType = 0; 
        oRegionalSettings.ShowWeeks = true; 
        oWebsiteRoot.Update(); 
    }
}

Dica

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Ver também

Referência

SPRegionalSettings class

SPRegionalSettings members

Microsoft.SharePoint namespace