static private ParseVersion ( string version, string hintPath ) : System.Version | ||
version | string | |
hintPath | string | |
return | System.Version |
private void AddIdentity(string name, string version, string hintPath) { if (name.Length == 0) { throw new System.ArgumentException("Identity needs a name"); } for (int i = 0; i < name.Length; i++) { char c = name[i]; if (!char.IsLetterOrDigit(c) && c != '.' && c != '_') { throw new System.ArgumentException("Identity name contains invalid character: '" + c + "'"); } } System.Version value = AddInReference.ParseVersion(version, hintPath); if (this.primaryVersion == null) { this.primaryVersion = value; } if (this.primaryIdentity == null) { this.primaryIdentity = name; } this.identities.Add(name, value); }
void AddIdentity(string name, string version, string hintPath) { if (name.Length == 0) { throw new AddInLoadException("Identity needs a name"); } foreach (char c in name) { if (!char.IsLetterOrDigit(c) && c != '.' && c != '_') { throw new AddInLoadException("Identity name contains invalid character: '" + c + "'"); } } Version v = AddInReference.ParseVersion(version, hintPath); if (primaryVersion == null) { primaryVersion = v; } if (primaryIdentity == null) { primaryIdentity = name; } identities.Add(name, v); }
public static AddInReference Create(Properties properties, string hintPath) { AddInReference addInReference = new AddInReference(properties["addin"]); string text = properties["version"]; if (text != null && text.Length > 0) { int num = text.IndexOf('-'); if (num > 0) { addInReference.minimumVersion = AddInReference.ParseVersion(text.Substring(0, num), hintPath); addInReference.maximumVersion = AddInReference.ParseVersion(text.Substring(num + 1), hintPath); } else { addInReference.maximumVersion = (addInReference.minimumVersion = AddInReference.ParseVersion(text, hintPath)); } if (addInReference.Name == "SharpDevelop" && (addInReference.maximumVersion == new System.Version("3.0") || addInReference.maximumVersion == new System.Version("3.1"))) { addInReference.maximumVersion = new System.Version("3.2"); } } addInReference.requirePreload = string.Equals(properties["requirePreload"], "true", System.StringComparison.OrdinalIgnoreCase); return(addInReference); }