SPContentType.GetLocalizations-Methode

Gibt die Auflistung der lokalisierten Versionen für den Inhaltstyp für die angegebene Kultur zurück.

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

Syntax

'Declaration
Public Function GetLocalizations ( _
    cultureInfo As CultureInfo _
) As SPLocalizationCollection
'Usage
Dim instance As SPContentType
Dim cultureInfo As CultureInfo
Dim returnValue As SPLocalizationCollection

returnValue = instance.GetLocalizations(cultureInfo)
public SPLocalizationCollection GetLocalizations(
    CultureInfo cultureInfo
)

Parameter

Rückgabewert

Typ: Microsoft.SharePoint.SPLocalizationCollection
Ein Wörterbuch von Zeichenfolgen, die Gebietsschemas darstellen, die durch den Inhaltstyp unterstützt werden. Für einen Listeninhaltstyp ist das SPLocalizationCollection -Objekt ein Nullverweis (Nothing in Visual Basic).

Beispiele

Im folgenden Beispiel wird eine Konsolenanwendung, die die Auflistung der Websiteinhaltstypen durchlaufen und gibt die Anzahl der lokalisierten Versionen für jeden Typ gehört.

Dim site As SPSite = New SPSite("https://localhost")
Dim web As SPWeb = site.OpenWeb()

Console.WriteLine("The site locale is " + web.Locale.Name)
Console.WriteLine("The culture identifier (Lcid) is " + web.Language.ToString())

For Each contentType As SPContentType In web.ContentTypes
    Dim localizations As SPLocalizationCollection = _
        contentType.GetLocalizations(web.Locale)
    Console.Write("The {0} content type has ", contentType.Name)
    Console.WriteLine(" {0} localizations", localizations.Count.ToString())
Next contentType

' Clean up.
web.Dispose()
site.Dispose()
SPSite site = new SPSite("https://localhost");
SPWeb web = site.OpenWeb();

Console.WriteLine("The site locale is " + web.Locale.Name);
Console.WriteLine("The culture identifier (Lcid) is " + web.Language.ToString());

foreach (SPContentType contentType in web.ContentTypes)
{
    SPLocalizationCollection localizations = 
        contentType.GetLocalizations(web.Locale);
    Console.Write("The {0} content type has ", contentType.Name);
    Console.WriteLine(" {0} localizations", localizations.Count.ToString());
}

// Clean up.
web.Dispose();
site.Dispose();

Siehe auch

Referenz

SPContentType Klasse

SPContentType-Member

Microsoft.SharePoint-Namespace

Weitere Ressourcen

Introduction to Content Types

Site and List Content Types

Base Content Type Hierarchy