7 [global::__DynamicallyInvokable]
10 private readonly
string m_identifier;
12 private readonly
Version m_version;
14 private readonly
string m_profile;
16 private string m_fullName;
18 private const char c_componentSeparator =
',';
20 private const char c_keyValueSeparator =
'=';
22 private const char c_versionValuePrefix =
'v';
24 private const string c_versionKey =
"Version";
26 private const string c_profileKey =
"Profile";
30 [global::__DynamicallyInvokable]
33 [global::__DynamicallyInvokable]
42 [global::__DynamicallyInvokable]
45 [global::__DynamicallyInvokable]
54 [global::__DynamicallyInvokable]
57 [global::__DynamicallyInvokable]
66 [global::__DynamicallyInvokable]
69 [global::__DynamicallyInvokable]
72 if (m_fullName ==
null)
80 if (!
string.IsNullOrEmpty(
Profile))
86 m_fullName = stringBuilder.
ToString();
96 [global::__DynamicallyInvokable]
97 public override bool Equals(
object obj)
106 [global::__DynamicallyInvokable]
109 if ((
object)other ==
null)
122 [global::__DynamicallyInvokable]
130 [global::__DynamicallyInvokable]
144 [global::__DynamicallyInvokable]
146 : this(identifier, version, null)
159 [global::__DynamicallyInvokable]
162 if (identifier ==
null)
166 if (identifier.Trim().Length == 0)
168 throw new ArgumentException(SR.GetString(
"net_emptystringcall",
"identifier"),
"identifier");
174 m_identifier = identifier.Trim();
176 m_profile = ((profile ==
null) ?
string.Empty : profile.Trim());
188 [global::__DynamicallyInvokable]
191 if (frameworkName ==
null)
195 if (frameworkName.Length == 0)
197 throw new ArgumentException(SR.GetString(
"net_emptystringcall",
"frameworkName"),
"frameworkName");
199 string[] array = frameworkName.Split(
',');
200 if (array.Length < 2 || array.Length > 3)
202 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameTooShort"),
"frameworkName");
204 m_identifier = array[0].Trim();
205 if (m_identifier.Length == 0)
207 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameInvalid"),
"frameworkName");
210 m_profile =
string.Empty;
211 for (
int i = 1; i < array.Length; i++)
213 string[] array2 = array[i].Split(
'=');
214 if (array2.Length != 2)
216 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameInvalid"),
"frameworkName");
218 string text = array2[0].Trim();
219 string text2 = array2[1].Trim();
223 if (text2.Length > 0 && (text2[0] ==
'v' || text2[0] ==
'V'))
225 text2 = text2.Substring(1);
229 m_version =
new Version(text2);
233 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameInvalidVersion"),
"frameworkName", innerException);
239 if (!
string.IsNullOrEmpty(text2))
245 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameInvalid"),
"frameworkName");
249 throw new ArgumentException(SR.GetString(
"Argument_FrameworkNameMissingVersion"),
"frameworkName");
258 [global::__DynamicallyInvokable]
261 return left?.
Equals(right) ?? ((object)right ==
null);
269 [global::__DynamicallyInvokable]
272 return !(left == right);
override int GetHashCode()
Returns a hash code for the current T:System.Version object.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static bool operator !=(FrameworkName left, FrameworkName right)
Returns a value that indicates whether two T:System.Runtime.Versioning.FrameworkName objects represen...
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
string Identifier
Gets the identifier of this T:System.Runtime.Versioning.FrameworkName object.
FrameworkName(string identifier, Version version, string profile)
Initializes a new instance of the T:System.Runtime.Versioning.FrameworkName class from a string,...
Version Version
Gets the version of this T:System.Runtime.Versioning.FrameworkName object.
string FullName
Gets the full name of this T:System.Runtime.Versioning.FrameworkName object.
bool Equals(FrameworkName other)
Returns a value that indicates whether this T:System.Runtime.Versioning.FrameworkName instance repres...
FrameworkName(string frameworkName)
Initializes a new instance of the T:System.Runtime.Versioning.FrameworkName class from a string that ...
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
FrameworkName(string identifier, Version version)
Initializes a new instance of the T:System.Runtime.Versioning.FrameworkName class from a string and a...
string Profile
Gets the profile name of this T:System.Runtime.Versioning.FrameworkName object.
override string ToString()
Returns the string representation of this T:System.Runtime.Versioning.FrameworkName object.
Represents the version number of an assembly, operating system, or the common language runtime....
static bool operator==(FrameworkName left, FrameworkName right)
Returns a value that indicates whether two T:System.Runtime.Versioning.FrameworkName objects represen...
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
The exception that is thrown when one of the arguments provided to a method is not valid.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Defines a generalized method that a value type or class implements to create a type-specific method f...
override bool Equals(object obj)
Returns a value that indicates whether this T:System.Runtime.Versioning.FrameworkName instance repres...
Specifies that the class can be serialized.
object Clone()
Returns a new T:System.Version object whose value is the same as the current T:System....
override int GetHashCode()
Returns the hash code for the T:System.Runtime.Versioning.FrameworkName object.
Represents the name of a version of the .NET Framework.