FrameworkName.Equality(FrameworkName, FrameworkName) FrameworkName.Equality(FrameworkName, FrameworkName) FrameworkName.Equality(FrameworkName, FrameworkName) FrameworkName.Equality(FrameworkName, FrameworkName) Operator

Definição

Retorna um valor que indica se dois objetos FrameworkName representam a mesma versão do .NET Framework.Returns a value that indicates whether two FrameworkName objects represent the same .NET Framework version.

public:
 static bool operator ==(System::Runtime::Versioning::FrameworkName ^ left, System::Runtime::Versioning::FrameworkName ^ right);
public static bool operator == (System.Runtime.Versioning.FrameworkName left, System.Runtime.Versioning.FrameworkName right);
static member ( = ) : System.Runtime.Versioning.FrameworkName * System.Runtime.Versioning.FrameworkName -> bool
Public Shared Operator == (left As FrameworkName, right As FrameworkName) As Boolean

Parâmetros

left
FrameworkName FrameworkName FrameworkName FrameworkName

O primeiro objeto a ser comparado.The first object to compare.

right
FrameworkName FrameworkName FrameworkName FrameworkName

O segundo objeto a ser comparado.The second object to compare.

Retornos

true se os parâmetros left e right representam a mesma versão do .NET Framework; caso contrário, false.true if the left and right parameters represent the same .NET Framework version; otherwise, false.

Exemplos

O exemplo a seguir usa o operador de igualdade para determinar se um FrameworkName objeto que representa a versão em execução do .NET Framework é igual a uma versão com suporte do .NET Framework.The following example uses the equality operator to determine whether a FrameworkName object that represents the running version of the .NET Framework is equal to a supported version of the .NET Framework. Observe que as duas versões não são iguais, porque eles não têm números de versão idênticos.Note that the two versions are not equal because they do not have identical version numbers.

FrameworkName supportedVer1 = new FrameworkName(".NET Framework, Version=4.0");
FrameworkName actualVersion = new FrameworkName(String.Format(
                                           ".NET Framework, Version={0}", 
                                           Environment.Version.ToString()));
                                           
Console.WriteLine("Supported Version: {0}", supportedVer1);
Console.WriteLine("Actual Version:    {0}", actualVersion);
if (supportedVer1 == actualVersion)    
   Console.WriteLine("The supported and actual Framework versions are the same.");
else
   Console.WriteLine("The supported and actual Framework versions are different.");

Console.WriteLine();
// The example displays the following output:
//       The supported and actual Framework versions are different.       
Dim supportedVer1 As New FrameworkName(".NET Framework, Version=4.0")
Dim actualVersion As New FrameworkName(String.Format(".NET Framework, Version={0}", 
                                       Environment.Version.ToString())) 

Console.WriteLine("Supported Version: {0}", supportedVer1)
Console.WriteLine("Actual Version:    {0}", actualVersion)
If supportedVer1 = actualVersion Then
   Console.WriteLine("The supported and actual Framework versions are the same.")
Else
   Console.WriteLine("The supported and actual Framework versions are different.")
End If 
Console.WriteLine()
' The example displays the following output:
'      Supported Version: .NET Framework,Version=v4.0
'      Actual Version:    .NET Framework,Version=v4.0.30319.18010
'      The supported and actual Framework versions are different.

Comentários

O Equality método define a operação do operador de igualdade para FrameworkName objetos.The Equality method defines the operation of the equality operator for FrameworkName objects.

Linguagens que não dão suporte a operadores personalizados podem chamar o método FrameworkName.Equals(FrameworkName) em vez disso.Languages that do not support custom operators can call the FrameworkName.Equals(FrameworkName) method instead.

Aplica-se a