Пример #1
0
 /// <summary>
 ///     Returns a hash code for this instance.
 /// </summary>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         return((AssemblyId.GetHashCode() * 397) ^ (TypeName != null ? TypeName.GetHashCode() : 0));
     }
 }
Пример #2
0
 public override int GetHashCode()
 {
     return(Id.GetHashCode() ^
            AssemblyId.GetHashCode() ^
            PluginId.GetHashCode() ^
            StepId.GetHashCode() ^
            Attributes.GetHashCode() ^
            Name.GetHashCode() ^
            RelatedAttribute.GetHashCode() ^
            EntityAlias.GetHashCode() ^
            ImageType.GetHashCode() ^
            MessagePropertyName.GetHashCode());
 }
Пример #3
0
        /// <summary>
        ///     Compares to.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns>System.Int32.</returns>
        /// <inheritdoc />
        public int CompareTo(DumpTypeKey other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var assemblyIdComparison = AssemblyId.CompareTo(other.AssemblyId);

            if (assemblyIdComparison != 0)
            {
                return(assemblyIdComparison);
            }
            return(string.Compare(TypeName, other.TypeName, StringComparison.Ordinal));
        }
Пример #4
0
        private static void FindSequencePointForType(RunStartParams rsp, PerDocumentSequencePoints perDocSP, ModuleDefinition module, TypeDefinition type)
        {
            foreach (MethodDefinition meth in type.Methods)
            {
                if (IsMethodSkipped(meth))
                {
                    continue;
                }

                var sps = from i in meth.Body.Instructions
                          where i.SequencePoint != null
                          where i.SequencePoint.StartLine != 0xfeefee
                          select new { module, meth, i.SequencePoint };

                int id = 0;
                foreach (var sp in sps)
                {
                    var fp     = PathBuilder.rebaseCodeFilePath(rsp.Solution.Path, rsp.Solution.SnapshotPath, FilePath.NewFilePath(sp.SequencePoint.Document.Url));
                    var seqPts = perDocSP.GetOrAdd(fp, _ => new ConcurrentBag <R4nd0mApps.TddStud10.Common.Domain.SequencePoint>());

                    seqPts.Add(new R4nd0mApps.TddStud10.Common.Domain.SequencePoint
                    {
                        id = new SequencePointId
                        {
                            methodId = new MethodId(AssemblyId.NewAssemblyId(sp.module.Mvid), MdTokenRid.NewMdTokenRid(sp.meth.MetadataToken.RID)),
                            uid      = id++
                        },
                        document    = fp,
                        startLine   = DocumentCoordinate.NewDocumentCoordinate(sp.SequencePoint.StartLine),
                        startColumn = DocumentCoordinate.NewDocumentCoordinate(sp.SequencePoint.StartColumn),
                        endLine     = DocumentCoordinate.NewDocumentCoordinate(sp.SequencePoint.EndLine),
                        endColumn   = DocumentCoordinate.NewDocumentCoordinate(sp.SequencePoint.EndColumn),
                    });
                }
            }
        }
Пример #5
0
        public bool Equals(SDClrModule other)
        {
            bool equals = false;

            // if dynamic module, only compare IDs
            if (this.IsDynamic || other.IsDynamic)
            {
                equals = this.AssemblyId.Equals(other.AssemblyId);
            }
            else
            {
                if (AssemblyId.Equals(other.AssemblyId) &&
                    this.AssemblyName.Equals(other.AssemblyName) &&
                    this.IsDynamic.Equals(other.IsDynamic) &&
                    this.IsFile.Equals(other.IsFile) &&
                    this.Size.Equals(other.Size) &&
                    this.Pdb.Equals(other.Pdb) &&
                    this.Name.Equals(other.Name))
                {
                    equals = true;
                }
            }
            return(equals);
        }