224 lines
7.2 KiB
C#
224 lines
7.2 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
|
|
namespace System
|
|
{
|
|
/// <summary>Contains information used to uniquely identify a manifest-based application. This class cannot be inherited.</summary>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x02000635 RID: 1589
|
|
[ComVisible(true)]
|
|
[Serializable]
|
|
public sealed class ApplicationId
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ApplicationId" /> class.</summary>
|
|
/// <param name="publicKeyToken">The array of bytes representing the raw public key data. </param>
|
|
/// <param name="name">The name of the application. </param>
|
|
/// <param name="version">A <see cref="T:System.Version" /> object that specifies the version of the application. </param>
|
|
/// <param name="processorArchitecture">The processor architecture of the application. </param>
|
|
/// <param name="culture">The culture of the application. </param>
|
|
/// <exception cref="T:System.ArgumentNullException">
|
|
/// <paramref name="name " />is null.-or-<paramref name="version " />is null.-or-<paramref name="publicKeyToken " />is null.</exception>
|
|
/// <exception cref="T:System.ArgumentException">
|
|
/// <paramref name="name " />is an empty string.</exception>
|
|
// Token: 0x06003AFE RID: 15102 RVA: 0x000C9584 File Offset: 0x000C7784
|
|
public ApplicationId(byte[] publicKeyToken, string name, Version version, string processorArchitecture, string culture)
|
|
{
|
|
if (publicKeyToken == null)
|
|
{
|
|
throw new ArgumentNullException("publicKeyToken");
|
|
}
|
|
if (name == null)
|
|
{
|
|
throw new ArgumentNullException("name");
|
|
}
|
|
if (version == null)
|
|
{
|
|
throw new ArgumentNullException("version");
|
|
}
|
|
this._token = (byte[])publicKeyToken.Clone();
|
|
this._name = name;
|
|
this._version = version;
|
|
this._proc = processorArchitecture;
|
|
this._culture = culture;
|
|
}
|
|
|
|
/// <summary>Gets a string representing the culture information for the application.</summary>
|
|
/// <returns>The culture information for the application.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000B49 RID: 2889
|
|
// (get) Token: 0x06003AFF RID: 15103 RVA: 0x000C9600 File Offset: 0x000C7800
|
|
public string Culture
|
|
{
|
|
get
|
|
{
|
|
return this._culture;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the name of the application.</summary>
|
|
/// <returns>The name of the application.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000B4A RID: 2890
|
|
// (get) Token: 0x06003B00 RID: 15104 RVA: 0x000C9608 File Offset: 0x000C7808
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
return this._name;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the target processor architecture for the application.</summary>
|
|
/// <returns>The processor architecture of the application.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000B4B RID: 2891
|
|
// (get) Token: 0x06003B01 RID: 15105 RVA: 0x000C9610 File Offset: 0x000C7810
|
|
public string ProcessorArchitecture
|
|
{
|
|
get
|
|
{
|
|
return this._proc;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the public key token for the application.</summary>
|
|
/// <returns>A byte array containing the public key token for the application.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000B4C RID: 2892
|
|
// (get) Token: 0x06003B02 RID: 15106 RVA: 0x000C9618 File Offset: 0x000C7818
|
|
public byte[] PublicKeyToken
|
|
{
|
|
get
|
|
{
|
|
return (byte[])this._token.Clone();
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the version of the application.</summary>
|
|
/// <returns>A <see cref="T:System.Version" /> that specifies the version of the application.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000B4D RID: 2893
|
|
// (get) Token: 0x06003B03 RID: 15107 RVA: 0x000C962C File Offset: 0x000C782C
|
|
public Version Version
|
|
{
|
|
get
|
|
{
|
|
return this._version;
|
|
}
|
|
}
|
|
|
|
/// <summary>Creates and returns an identical copy of the current application identity.</summary>
|
|
/// <returns>An <see cref="T:System.ApplicationId" /> object that represents an exact copy of the original.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x06003B04 RID: 15108 RVA: 0x000C9634 File Offset: 0x000C7834
|
|
public ApplicationId Copy()
|
|
{
|
|
return new ApplicationId(this._token, this._name, this._version, this._proc, this._culture);
|
|
}
|
|
|
|
/// <summary>Determines whether the specified <see cref="T:System.ApplicationId" /> object is equivalent to the current <see cref="T:System.ApplicationId" />.</summary>
|
|
/// <returns>true if the specified <see cref="T:System.ApplicationId" /> object is equivalent to the current <see cref="T:System.ApplicationId" />; otherwise, false.</returns>
|
|
/// <param name="o">The <see cref="T:System.ApplicationId" /> object to compare to the current <see cref="T:System.ApplicationId" />. </param>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x06003B05 RID: 15109 RVA: 0x000C965C File Offset: 0x000C785C
|
|
public override bool Equals(object o)
|
|
{
|
|
if (o == null)
|
|
{
|
|
return false;
|
|
}
|
|
ApplicationId applicationId = o as ApplicationId;
|
|
if (applicationId == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (this._name != applicationId._name)
|
|
{
|
|
return false;
|
|
}
|
|
if (this._proc != applicationId._proc)
|
|
{
|
|
return false;
|
|
}
|
|
if (this._culture != applicationId._culture)
|
|
{
|
|
return false;
|
|
}
|
|
if (!this._version.Equals(applicationId._version))
|
|
{
|
|
return false;
|
|
}
|
|
if (this._token.Length != applicationId._token.Length)
|
|
{
|
|
return false;
|
|
}
|
|
for (int i = 0; i < this._token.Length; i++)
|
|
{
|
|
if (this._token[i] != applicationId._token[i])
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
/// <summary>Gets the hash code for the current application identity.</summary>
|
|
/// <returns>The hash code for the current application identity.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x06003B06 RID: 15110 RVA: 0x000C9728 File Offset: 0x000C7928
|
|
public override int GetHashCode()
|
|
{
|
|
int num = this._name.GetHashCode() ^ this._version.GetHashCode();
|
|
for (int i = 0; i < this._token.Length; i++)
|
|
{
|
|
num ^= (int)this._token[i];
|
|
}
|
|
return num;
|
|
}
|
|
|
|
/// <summary>Creates and returns a string representation of the application identity.</summary>
|
|
/// <returns>A string representation of the application identity.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x06003B07 RID: 15111 RVA: 0x000C9774 File Offset: 0x000C7974
|
|
public override string ToString()
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
stringBuilder.Append(this._name);
|
|
if (this._culture != null)
|
|
{
|
|
stringBuilder.AppendFormat(", culture=\"{0}\"", this._culture);
|
|
}
|
|
stringBuilder.AppendFormat(", version=\"{0}\", publicKeyToken=\"", this._version);
|
|
for (int i = 0; i < this._token.Length; i++)
|
|
{
|
|
stringBuilder.Append(this._token[i].ToString("X2"));
|
|
}
|
|
if (this._proc != null)
|
|
{
|
|
stringBuilder.AppendFormat("\", processorArchitecture =\"{0}\"", this._proc);
|
|
}
|
|
else
|
|
{
|
|
stringBuilder.Append("\"");
|
|
}
|
|
return stringBuilder.ToString();
|
|
}
|
|
|
|
// Token: 0x0400179A RID: 6042
|
|
private byte[] _token;
|
|
|
|
// Token: 0x0400179B RID: 6043
|
|
private string _name;
|
|
|
|
// Token: 0x0400179C RID: 6044
|
|
private Version _version;
|
|
|
|
// Token: 0x0400179D RID: 6045
|
|
private string _proc;
|
|
|
|
// Token: 0x0400179E RID: 6046
|
|
private string _culture;
|
|
}
|
|
}
|