コード例 #1
0
ファイル: CandidateInfo.cs プロジェクト: lanicon/Nesp
 private CandidateInfo(
     CandidatesDictionary <ConstantExpression> types,
     CandidatesDictionary <Expression> fields,
     CandidatesDictionary <MemberExpression> properties,
     CandidatesDictionary <MethodInfo> methods,
     CandidatesDictionary <Expression> locals)
 {
     this.Types      = types;
     this.Fields     = fields;
     this.Properties = properties;
     this.Methods    = methods;
     this.Locals     = locals;
 }
コード例 #2
0
ファイル: CandidatesDictionary.cs プロジェクト: lanicon/Nesp
        public bool Equals(CandidatesDictionary <T> rhs)
        {
            if (object.ReferenceEquals(original, rhs.original) == false)
            {
                if ((original == null) || (rhs.original == null))
                {
                    return(false);
                }
                if (original.Count != rhs.original.Count)
                {
                    return(false);
                }

                if (original.All(entry =>
                                 rhs.original.TryGetValue(entry.Key, out var candidates) &&
                                 entry.Value.SequenceEqual(candidates)) == false)
                {
                    return(false);
                }
            }

            if (object.ReferenceEquals(inner, rhs.inner) == false)
            {
                if ((inner == null) || (rhs.inner == null))
                {
                    return(false);
                }
                if (inner.Count != rhs.inner.Count)
                {
                    return(false);
                }

                if (inner.All(entry =>
                              rhs.inner.TryGetValue(entry.Key, out var candidates) &&
                              entry.Value.SequenceEqual(candidates)) == false)
                {
                    return(false);
                }
            }

            return(true);
        }