コード例 #1
0
 int IEqualityComparer <Options> .GetHashCode(Options obj)
 {
     return
         (Hashing.GetHashCode(GetTemplateComparer(obj.MatchCase).GetHashCode(obj.Template),
                              Hashing.GetHashCode(obj.WholeWord.GetHashCode(),
                                                  Hashing.GetHashCode(obj.MatchCase.GetHashCode(),
                                                                      Hashing.GetHashCode(obj.ContentTypes.GetHashCode(),
                                                                                          Hashing.GetHashCode(obj.Scope.GetHashCode()
                                                                                                              ))))));
 }
コード例 #2
0
ファイル: FilterTarget.cs プロジェクト: rkapl123/logjoint
 public override int GetHashCode()
 {
     if (hash == null)
     {
         if (MatchesAllSourcesInternal())
         {
             hash = RuntimeHelpers.GetHashCode(FilterScope.DefaultScope);
         }
         else
         {
             hash = Hashing.GetHashCode(includeAllFromSources.Select(s => s.GetHashCode()).Union(includeAllFromThreads.Select(t => t.GetHashCode())));
         }
     }
     return(hash.Value);
 }
コード例 #3
0
        /// <summary>
        /// Calculates an integer hash out of all fields that the message builder type depends on
        /// </summary>
        int GetMessageBuilderTypeHash()
        {
            int typeHash = Hashing.GetHashCode(0);

            foreach (string i in inputFieldNames)
            {
                typeHash = Hashing.GetHashCode(typeHash, i.GetHashCode());
            }
            foreach (OutputFieldStruct i in outputFields)
            {
                typeHash = Hashing.GetHashCode(typeHash, (int)i.Type);
                typeHash = Hashing.GetHashCode(typeHash, i.Name.GetHashCode());
                typeHash = Hashing.GetHashCode(typeHash, i.Code.GetHashCode());
            }
            foreach (ExtensionInfo i in extensions)
            {
                typeHash = Hashing.GetHashCode(typeHash, i.ExtensionAssemblyName.GetType().GetHashCode());
                typeHash = Hashing.GetHashCode(typeHash, i.ExtensionClassName.GetType().GetHashCode());
                typeHash = Hashing.GetHashCode(typeHash, i.ExtensionName.GetHashCode());
            }
            return(typeHash);
        }