Compartir a través de


Reference3.Culture Property

Gets the culture string of a reference.

Namespace:  VSLangProj80
Assembly:  VSLangProj80 (in VSLangProj80.dll)

Syntax

'Declaration
ReadOnly Property Culture As String
string Culture { get; }
property String^ Culture {
    String^ get ();
}
abstract Culture : string with get
function get Culture () : String

Property Value

Type: System.String
The return value depends on the reference type.

Reference Type

Value Returned

Assembly

Culture string. For example, "EN-US" for English - United States.

COM

Locale ID. The string is the hex locale ID of the type library being referenced. For example, "0" for multilanguage or "409" for English - United States.

Remarks

Culture information includes language and calendar specifications. For information about valid strings, see CultureInfo.

Examples

This example displays the culture value of each reference in an open Visual Basic or Visual C# project. To run this example as an add-in, see How to: Compile and Run the Automation Object Model Code Examples. For an additional example, see Reference3.

Imports VSLangProj
Imports VSLangProj2
Imports VSLangProj80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    applicationObject = CType(application, DTE2)
    addInInstance = CType(addInInst, AddIn)
    DisplayCultures(applicationObject)
End Sub
Public Sub DisplayCultures(ByVal dte As DTE2)
    ' The first project is a Visual Basic or C# project.
    Dim vsProject As VSProject2 = _
    CType(dte.Solution.Projects.Item(1).Object, VSProject2)
    Dim aRef As Reference3
    For Each aRef In vsProject.References
        MsgBox(aRef.Name & " has a culture value of: " _
        & aRef.Culture.ToString())
    Next
End Sub
using System.Windows.Forms;
using VSLangProj;
using VSLangProj2;
using VSLangProj80;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    applicationObject = (DTE2)application;
    addInInstance = (AddIn)addInInst;
    DisplayCultures(((DTE2)applicationObject));
}

public void DisplayCultures(DTE2 dte)
{
    // The first project is a Visual Basic or C# project.
    VSProject2 vsProject =
 ((VSProject2)(applicationObject.Solution.Projects.Item(1).Object));
    Reference3 aRef = null;
    foreach (VSLangProj80.Reference3 temp in vsProject.References)
    {
        aRef = temp;
         MessageBox.Show(aRef.Name + " has a culture value of: " 
+ aRef.Culture.ToString());
    }
}

.NET Framework Security

See Also

Reference

Reference3 Interface

VSLangProj80 Namespace