本文整理汇总了C#中ISymbolDocument类的典型用法代码示例。如果您正苦于以下问题:C# ISymbolDocument类的具体用法?C# ISymbolDocument怎么用?C# ISymbolDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISymbolDocument类属于命名空间,在下文中一共展示了ISymbolDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
public SequencePoint[] Generate(ISymbolMethod method)
{
var sequencePoints = new List<SequencePoint>();
var sp_count = method.SequencePointCount;
var spOffsets = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spDocs = new ISymbolDocument[sp_count]; // Array.CreateInstance(ISymbolDocument, sp_count)
var spStartLines = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spEndLines = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spStartCol = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spEndCol = new int[sp_count]; // Array.CreateInstance(int, sp_count)
method.GetSequencePoints(spOffsets, spDocs, spStartLines, spStartCol, spEndLines, spEndCol);
for (int i = 0; i < sp_count; i++) // (var i in range(sp_count))
{
if (spStartLines[i] != 0xfeefee) // if spStartLines[i] != 0xfeefee:
{
sequencePoints.Add(new SequencePoint(spOffsets[i],
spDocs[i],
spStartLines[i],
spStartCol[i],
spEndLines[i],
spEndCol[i]));
}
}
return sequencePoints.ToArray();
}
示例2: ArgumentException
void ISymbolMethod.GetSequencePoints(int[] offsets, ISymbolDocument[] documents, int[] lines, int[] columns,
int[] endLines, int[] endColumns) {
int count = Lines == null ? 0 : Lines.Count;
if (offsets != null && offsets.Length != count)
throw new ArgumentException("Invalid array length: offsets");
if (documents != null && documents.Length != count)
throw new ArgumentException("Invalid array length: documents");
if (lines != null && lines.Length != count)
throw new ArgumentException("Invalid array length: lines");
if (columns != null && columns.Length != count)
throw new ArgumentException("Invalid array length: columns");
if (endLines != null && endLines.Length != count)
throw new ArgumentException("Invalid array length: endLines");
if (endColumns != null && endColumns.Length != count)
throw new ArgumentException("Invalid array length: endColumns");
if (count <= 0)
return;
int i = 0;
foreach (var line in Lines) {
offsets[i] = (int)line.Offset;
documents[i] = line.Document;
lines[i] = (int)line.LineBegin;
columns[i] = (int)line.ColumnBegin;
endLines[i] = (int)line.LineEnd;
endColumns[i] = (int)line.ColumnEnd;
i++;
}
}
示例3: GetSequencePoints
public void GetSequencePoints(int[] offsets, ISymbolDocument[] documents, int[] lines, int[] columns, int[] endLines, int[] endColumns) {
// Any array can be null, and the documentation says we must verify the sizes.
int arySize = -1;
if (offsets != null) arySize = offsets.Length;
else if (documents != null) arySize = documents.Length;
else if (lines != null) arySize = lines.Length;
else if (columns != null) arySize = columns.Length;
else if (endLines != null) arySize = endLines.Length;
else if (endColumns != null)arySize = endColumns.Length;
if (offsets != null && offsets.Length != arySize) throw new ArgumentException("Invalid array length: offsets");
if (documents != null && documents.Length != arySize) throw new ArgumentException("Invalid array length: documents");
if (lines != null && lines.Length != arySize) throw new ArgumentException("Invalid array length: lines");
if (columns != null && columns.Length != arySize) throw new ArgumentException("Invalid array length: columns");
if (endLines != null && endLines.Length != arySize) throw new ArgumentException("Invalid array length: endLines");
if (endColumns != null && endColumns.Length != arySize) throw new ArgumentException("Invalid array length: endColumns");
if (arySize <= 0)
return;
var unDocs = documents == null ? null : new ISymUnmanagedDocument[documents.Length];
uint size;
method.GetSequencePoints((uint)arySize, out size, offsets, unDocs, lines, columns, endLines, endColumns);
if (unDocs != null) {
for (int i = 0; i < unDocs.Length; i++)
documents[i] = unDocs[i] == null ? null : new SymbolDocument(unDocs[i]);
}
}
示例4: GetOffset
public int GetOffset(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
uint result;
method.GetOffset(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, out result);
return (int)result;
}
示例5: SequencePoint
// Constructor.
public SequencePoint(int offset, ISymbolDocument document,
int line, int column)
{
this.offset = offset;
this.document = document;
this.line = line;
this.column = column;
}
示例6: SequencePoint
public SequencePoint(int offset, ISymbolDocument document, int lineStart, int lineStartColumn, int lineEnd, int lineEndColumn)
{
Offset = offset;
Document = document;
LineStart = lineStart;
LineStartColumn = lineStartColumn;
LineEnd = lineEnd;
LineEndColumn = lineEndColumn;
}
示例7: SourceDocument
internal SourceDocument(string[] lines, string location, ISymbolDocument symbols)
{
this.Lines = lines;
this.Content = string.Join(Environment.NewLine, lines);
this.Location = location;
this.Symbols = symbols;
}
示例8: SequencePoint
public SequencePoint(int offset, ISymbolDocument document, int startLine, int startColumn, int endLine,
int endColumn)
{
this.offset = offset;
this.document = document;
this.startLine = startLine;
this.startColumn = startColumn;
this.endLine = endLine;
this.endColumn = endColumn;
}
示例9: PdbDocument
/// <summary>
/// Constructor
/// </summary>
/// <param name="symDoc">A <see cref="ISymbolDocument"/> instance</param>
public PdbDocument(ISymbolDocument symDoc) {
if (symDoc == null)
throw new ArgumentNullException("symDoc");
this.Url = symDoc.URL;
this.Language = symDoc.Language;
this.LanguageVendor = symDoc.LanguageVendor;
this.DocumentType = symDoc.DocumentType;
this.CheckSumAlgorithmId = symDoc.CheckSumAlgorithmId;
this.CheckSum = symDoc.GetCheckSum();
}
示例10: GetRanges
public int[] GetRanges(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
uint arySize;
method.GetRanges(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, 0, out arySize, null);
var ary = new int[arySize];
method.GetRanges(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, (uint)ary.Length, out arySize, ary);
return ary;
}
示例11: GetOrLoadContent
private SourceDocument GetOrLoadContent(ISymbolDocument symbols)
{
var location = symbols.URL;
if (!File.Exists(location))
return null;
return documentCache.Get(
location, () => new SourceDocument(File.ReadAllLines(location), location, symbols)
);
}
示例12: GetDocuments
public ISymbolDocument[] GetDocuments() {
uint numDocs;
reader.GetDocuments(0, out numDocs, null);
var unDocs = new ISymUnmanagedDocument[numDocs];
reader.GetDocuments((uint)unDocs.Length, out numDocs, unDocs);
var docs = new ISymbolDocument[numDocs];
for (uint i = 0; i < numDocs; i++)
docs[i] = new SymbolDocument(unDocs[i]);
return docs;
}
示例13: GetMethodFromDocumentPosition
public ISymbolMethod GetMethodFromDocumentPosition(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
ISymUnmanagedMethod unMethod;
int hr = reader.GetMethodFromDocumentPosition(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, out unMethod);
if (hr == E_FAIL)
return null;
Marshal.ThrowExceptionForHR(hr);
return unMethod == null ? null : new SymbolMethod(unMethod);
}
示例14: attemptSetBreakpoint
private bool attemptSetBreakpoint(ISymbolReader reader, ISymbolDocument doc, CorModule module)
{
if (!doc.URL.Equals(_breakpoint.File))
return false;
var line = doc.FindClosestLine(_breakpoint.Line);
var method = reader.GetMethodFromDocumentPosition(doc, line, _breakpoint.Column);
var function = module.GetFunctionFromToken(method.Token.GetToken());
var wasSet = attemptToSetBreakpointThroughSequencePoints(doc, line, method, function);
if (!wasSet)
setBreakpointThroughFunction(function);
return true;
}
示例15: attemptToSetBreakpointThroughSequencePoints
private bool attemptToSetBreakpointThroughSequencePoints(ISymbolDocument doc, int line, ISymbolMethod method, CorFunction function)
{
bool found = false;
foreach (var sp in getSequencePoints(method))
{
if (sp.Document.URL.Equals(doc.URL) && sp.LineStart.Equals(line))
{
var bp = function.ILCode.CreateBreakpoint(sp.Offset);
bp.Activate(true);
found = true;
break;
}
}
return found;
}