/// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Name?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Path?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ConfigFilePath?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (FileSystemAssemblyName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (GACAssemblyName?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
        public override bool CanSave()
        {
            var canSave = HasChanged;

            if (canSave)
            {
                canSave = (!string.IsNullOrEmpty(FileSystemAssemblyName) && FileSystemAssemblyName.EndsWith(".dll")) ||
                          (!string.IsNullOrEmpty(GACAssemblyName) && GACAssemblyName.StartsWith("GAC:"));
            }

            return(canSave);
        }
Exemplo n.º 3
0
#pragma warning disable S1541 // Methods and properties should not be too complex
        public override int GetHashCode()
#pragma warning restore S1541 // Methods and properties should not be too complex
        {
            unchecked
            {
                var hashCode = Name?.GetHashCode() ?? 0;
                hashCode = (hashCode * 397) ^ (Path?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (ConfigFilePath?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (FileSystemAssemblyName?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (GACAssemblyName?.GetHashCode() ?? 0);
                return(hashCode);
            }
        }