Aracılığıyla paylaş


Reference3.RevisionNumber Özellik

Başvuru sayısını alır.

Ad alanı:  VSLangProj80
Derleme:  VSLangProj80 (VSLangProj80.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property RevisionNumber As Integer
    Get
int RevisionNumber { get; }
property int RevisionNumber {
    int get ();
}
abstract RevisionNumber : int
function get RevisionNumber () : int

Özellik Değeri

Tür: System.Int32
Long.Döndürülen sayı, başvuru türüne göre değişir.

Başvuru türü

Döndürülen değer

Derleme

Başvuru düzeltme sürüm numarası; 0–9999.

COM

0

Yüklenen

Reference2.RevisionNumber

Açıklamalar

Başvuru sürümü dört bileşenleri tarafından benzersiz olarak tanımlanır: major, minor, build, and revision. Ana ve küçük bileşenleri gereklidir. Düzeltme bileşeni isteğe bağlı ne zaman build tanımlı değil. com nesneleri yok düzeltme ve build bileşenleri. Daha fazla bilgi için bkz. Assembly Versioning.

Örnekler

Bu örnek, bir derleme ve açık com başvurusu ekler Visual Basic veya Visual C# Proje ve sonra görüntüler kendi gözden geçirme numarası. Bir eklenti bu örneği çalıştırmak için bkz: Nasıl Yapılır: derlemek ve otomasyon nesne modeli kod örnekleri çalıştırma.

Eklenen başvurusu için varsayılan yolları şunlardır: < yükleme kök >\Program Files\Microsoft.NET\Primary Interop Assemblies ADODB.dll dosyasını için ve < yükleme kök >spcommon.dll \Program Files\Common Files\SpeechEngines\Microsoft. < dosya yolu > Değiştir Bu veya diğer uygun dosya yolları örnekte.

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)
    GetRevisionNumber(applicationObject)
End Sub 
Sub GetRevisionNumber(ByVal dte As DTE2)
    Dim aProject As Project
    Dim aVSProject As VSProject2
    aProject = applicationObject.Solution.Projects.Item(1)
    aVSProject = _
    CType(applicationObject.Solution.Projects.Item(1).Object, _
    VSProject2)
    ' Add an Assembly reference and display its minor version.
    Dim newRef As Reference3
    Try
        ' Replace <file path> with an actual file path.
        newRef = CType(aVSProject.References.Add _
        ("<file path>\adodb.dll"), Reference3)
    Catch e As System.Exception
    End Try
    MsgBox("Added an assembly reference, named: " & newRef.Name)
    MsgBox("The revision number of " & newRef.Name & " is " _
    & newRef.RevisionNumber.ToString())
    ' Add a COM reference and display its minor version.
    Try
        ' Replace <file path> with an actual file path.
        newRef = CType(aVSProject.References.Add_
        ("<file path>\spcommon.dll"),_
        Reference3)
    Catch e As System.Exception
    End Try
    MsgBox("Added a COM reference, named: " & newRef.Name)
    MsgBox("The revision number of " & newRef.Name & " is " _
    & newRef.RevisionNumber.ToString())
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;
    GetRevisionNumber(((DTE2)applicationObject));
}
public void GetRevisionNumber(DTE2 dte)
{
    // The first project is a Visual Basic or C# project.
    VSProject2 vsProject =
((VSProject2)(applicationObject.Solution.Projects.Item(1).Object));
    Reference3 aRef = null;
    // Add an Assembly reference and display its revision number.
    // Replace <file path> with an actual file path.
    aRef = (Reference3)vsProject.References.Add
(@"<file path>\adodb.dll");
    
    MessageBox.Show("Added an Assembly reference, named: " 
+ aRef.Name);
    MessageBox.Show("The revision number of " + aRef.Name + " is " 
+ aRef.RevisionNumber.ToString());
    // Add a COM reference and display its revision number.
    // Replace <file path> with an actual file path.
    aRef = (Reference3)vsProject.References.Add
(@"File path>\spcommon.dll");
    MessageBox.Show("Added a COM reference, named: " + aRef.Name);
MessageBox.Show("The revision number of " + aRef.Name + " is " 
+ aRef.RevisionNumber.ToString());
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Reference3 Arabirim

RevisionNumber Fazla Yük

VSLangProj80 Ad Alanı