コード例 #1
0
 // Get a hash code.
 public override int GetHashCode()
 {
     return((string.IsNullOrEmpty(this.FileName) ? 0 : this.FileName.GetHashCode()) ^
            this.StartLine.GetHashCode() ^
            this.StartColumn.GetHashCode() ^
            ((this.Checksum == null) ? 0 : SymbolHelper.GetHexStringFromChecksum(this.Checksum).GetHashCode()));
 }
コード例 #2
0
ファイル: StateManager.cs プロジェクト: wenzai007/dotnet462
            private ISymbolDocumentWriter GetSourceDocument(string fileName, byte[] checksum, Dictionary <string, byte[]> checksumCache)
            {
                ISymbolDocumentWriter documentWriter;
                string sourceDocKey = fileName + SymbolHelper.GetHexStringFromChecksum(checksum);

                if (!this.sourceDocuments.TryGetValue(sourceDocKey, out documentWriter))
                {
                    documentWriter =
                        dynamicModule.DefineDocument(
                            fileName,
                            StateManager.WorkflowLanguageGuid,
                            SymLanguageVendor.Microsoft,
                            SymDocumentType.Text);
                    this.sourceDocuments.Add(sourceDocKey, documentWriter);

                    byte[] checksumBytes;

                    if (checksumCache == null || !checksumCache.TryGetValue(fileName.ToUpperInvariant(), out checksumBytes))
                    {
                        checksumBytes = SymbolHelper.CalculateChecksum(fileName);
                    }

                    if (checksumBytes != null)
                    {
                        documentWriter.SetCheckSum(new Guid(Md5Identifier), checksumBytes);
                    }
                }
                return(documentWriter);
            }