本文整理汇总了C#中ISymbolDocumentWriter类的典型用法代码示例。如果您正苦于以下问题:C# ISymbolDocumentWriter类的具体用法?C# ISymbolDocumentWriter怎么用?C# ISymbolDocumentWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISymbolDocumentWriter类属于命名空间,在下文中一共展示了ISymbolDocumentWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProxyBuilderGeneratorItems
internal ProxyBuilderGeneratorItems(AssemblyBuilder assembly, ModuleBuilder module,
ISymbolDocumentWriter symbolDocumentWriter)
: this()
{
this.Assembly = assembly;
this.Module = module;
this.SymbolDocumentWriter = symbolDocumentWriter;
}
示例2: AddLineNumberInfo
internal void AddLineNumberInfo(ISymbolDocumentWriter document, int iOffset, int iStartLine, int iStartColumn, int iEndLine, int iEndColumn)
{
this.EnsureCapacity();
this.m_iOffsets[this.m_iLineNumberCount] = iOffset;
this.m_iLines[this.m_iLineNumberCount] = iStartLine;
this.m_iColumns[this.m_iLineNumberCount] = iStartColumn;
this.m_iEndLines[this.m_iLineNumberCount] = iEndLine;
this.m_iEndColumns[this.m_iLineNumberCount] = iEndColumn;
this.m_iLineNumberCount++;
}
示例3: SourceCodeWriter
internal SourceCodeWriter(string fileName, ISymbolDocumentWriter symbolDocumentWriter)
{
var directoryName = Path.GetDirectoryName(fileName);
if (!string.IsNullOrEmpty(directoryName))
Directory.CreateDirectory(directoryName);
_stringBuilder = new StringBuilder();
_sourceWriter = new StringWriter(_stringBuilder);
_fileName = fileName;
_symbolDocumentWriter = symbolDocumentWriter;
_currentLine = 1;
Indent = 0;
}
示例4: FindDocument
private int FindDocument(ISymbolDocumentWriter document)
{
if ((this.m_iLastFound >= this.m_DocumentCount) || (this.m_Documents[this.m_iLastFound].m_document != document))
{
for (int i = 0; i < this.m_DocumentCount; i++)
{
if (this.m_Documents[i].m_document == document)
{
this.m_iLastFound = i;
return this.m_iLastFound;
}
}
this.EnsureCapacity();
this.m_iLastFound = this.m_DocumentCount;
this.m_Documents[this.m_iLastFound] = new REDocument(document);
this.m_DocumentCount++;
}
return this.m_iLastFound;
}
示例5: FindDocument
// Find a REDocument representing document. If we cannot find one, we will add a new entry into
// the REDocument array.
private int FindDocument(ISymbolDocumentWriter document)
{
int i;
// This is an optimization. The chance that the previous line is coming from the same
// document is very high.
if (m_iLastFound < m_DocumentCount && m_Documents[m_iLastFound].m_document == document)
return m_iLastFound;
for (i = 0; i < m_DocumentCount; i++)
{
if (m_Documents[i].m_document == document)
{
m_iLastFound = i;
return m_iLastFound;
}
}
// cannot find an existing document so add one to the array
EnsureCapacity();
m_iLastFound = m_DocumentCount;
m_Documents[m_iLastFound] = new REDocument(document);
checked { m_DocumentCount++; }
return m_iLastFound;
}
示例6: DefineSequencePoints
/// <include file='doc\SymWriter.uex' path='docs/doc[@for="SymbolWriter.DefineSequencePoints"]/*' />
public void DefineSequencePoints(ISymbolDocumentWriter document,
int[] offsets,
int[] lines,
int[] columns,
int[] endLines,
int[] endColumns)
{
m_target.DefineSequencePoints(((SymDocumentWriter)document).InternalDocumentWriter, offsets.Length,
offsets, lines, columns, endLines, endColumns);
}
示例7: REDocument
internal REDocument(ISymbolDocumentWriter document)
{
this.m_document = document;
}
示例8: MarkSequencePoint
/// <summary>
/// Marks a sequence point in the Microsoft intermediate language (MSIL) stream.
/// </summary>
/// <param name="il"/>
/// <param name="document">The document for which the sequence point is being defined.</param>
/// <param name="startLine">The line where the sequence point begins.</param>
/// <param name="startColumn">The column in the line where the sequence point begins.</param>
/// <param name="endLine">The line where the sequence point ends.</param>
/// <param name="endColumn">The column in the line where the sequence point ends.</param>
public static ILGenerator MarkSequencePoint(
this ILGenerator il,
ISymbolDocumentWriter document,
int startLine,
int startColumn,
int endLine,
int endColumn)
{
il.MarkSequencePoint(document, startLine, startColumn, endLine, endColumn);
return il;
}
示例9: MarkSequencePoint
public virtual void MarkSequencePoint (ISymbolDocumentWriter document, int startLine,
int startColumn, int endLine, int endColumn)
{
if (currentSequence == null || currentSequence.Document != document) {
if (sequencePointLists == null)
sequencePointLists = new ArrayList ();
currentSequence = new SequencePointList (document);
sequencePointLists.Add (currentSequence);
}
currentSequence.AddSequencePoint (code_len, startLine, startColumn, endLine, endColumn);
}
示例10: SequencePointList
public SequencePointList (ISymbolDocumentWriter doc)
{
this.doc = doc;
}
示例11: MarkSequencePoint
public virtual void MarkSequencePoint(
ISymbolDocumentWriter document,
int startLine, // line number is 1 based
int startColumn, // column is 0 based
int endLine, // line number is 1 based
int endColumn) // column is 0 based
{
if (startLine == 0 || startLine < 0 || endLine == 0 || endLine < 0)
{
throw new ArgumentOutOfRangeException("startLine");
}
Contract.EndContractBlock();
m_LineNumberInfo.AddLineNumberInfo(document, m_length, startLine, startColumn, endLine, endColumn);
}
示例12: AddLineNumberInfo
internal void AddLineNumberInfo(
ISymbolDocumentWriter document,
int iOffset,
int iStartLine,
int iStartColumn,
int iEndLine,
int iEndColumn)
{
Contract.Assert(document == m_document, "Bad document look up!");
// make sure that arrays are large enough to hold addition info
EnsureCapacity();
m_iOffsets[m_iLineNumberCount] = iOffset;
m_iLines[m_iLineNumberCount] = iStartLine;
m_iColumns[m_iLineNumberCount] = iStartColumn;
m_iEndLines[m_iLineNumberCount] = iEndLine;
m_iEndColumns[m_iLineNumberCount] = iEndColumn;
checked { m_iLineNumberCount++; }
}
示例13: Emitter
public Emitter(EmitterOptions options)
{
_options = options;
_assemblyName = new AssemblyName(_options.AssemblyName);
_assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(_assemblyName, AssemblyBuilderAccess.RunAndSave);// TODO: temp for debugging .RunAndCollect);
if (_options.DebugOn)
_assembly.SetCustomAttribute
(
new CustomAttributeBuilder
(
typeof(DebuggableAttribute).GetConstructor
(
new System.Type[] { typeof(DebuggableAttribute.DebuggingModes) }
),
new object[]
{
DebuggableAttribute.DebuggingModes.DisableOptimizations |
DebuggableAttribute.DebuggingModes.Default
}
)
);
_module = _assembly.DefineDynamicModule(_assemblyName.Name, _assemblyName.Name + ".dll", _options.DebugOn);
if (_options.DebugOn)
_symbolWriter = _module.DefineDocument(_options.SourceFileName, Guid.Empty, Guid.Empty, Guid.Empty);
_tupleToNative = new Dictionary<Type.TupleType, System.Type>();
}
示例14: ILDynamicMethodDebugImpl
public ILDynamicMethodDebugImpl(string name, Type delegateType, Type thisType)
{
_delegateType = delegateType;
_expectedLength = 64;
var mi = delegateType.GetMethod("Invoke");
var uniqueName = ILDynamicTypeDebugImpl.UniqueName(name);
_assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName(uniqueName), AssemblyBuilderAccess.RunAndSave, DynamicILDirectoryPath.DynamicIL);
_moduleBuilder = _assemblyBuilder.DefineDynamicModule(uniqueName + ".dll", true);
var sourceCodeFileName = Path.Combine(DynamicILDirectoryPath.DynamicIL, uniqueName + ".il");
_symbolDocumentWriter = _moduleBuilder.DefineDocument(sourceCodeFileName, SymDocumentType.Text, SymLanguageType.ILAssembly, SymLanguageVendor.Microsoft);
_sourceCodeWriter = new SourceCodeWriter(sourceCodeFileName, _symbolDocumentWriter);
Type[] parameterTypes;
if (thisType != null)
{
parameterTypes = new[] { thisType }.Concat(mi.GetParameters().Select(pi => pi.ParameterType)).ToArray();
}
else
{
parameterTypes = mi.GetParameters().Select(pi => pi.ParameterType).ToArray();
}
_sourceCodeWriter.StartMethod(name, mi.ReturnType, parameterTypes, MethodAttributes.Static);
_typeBuilder = _moduleBuilder.DefineType(name, TypeAttributes.Public, typeof(object), Type.EmptyTypes);
_forbidenInstructions = new ILGenForbidenInstructionsCheating(_typeBuilder);
_dynamicMethod = _typeBuilder.DefineMethod("Invoke", MethodAttributes.Public | MethodAttributes.Static, mi.ReturnType, parameterTypes);
for (int i = 0; i < parameterTypes.Length; i++)
{
_dynamicMethod.DefineParameter(i + 1, ParameterAttributes.In, string.Format("arg{0}", i));
}
}
示例15: BeginModule
public void BeginModule(string ifile)
{
appdomain = System.Threading.Thread.GetDomain();
appname = getAssemblyName(filename);
appbuild = appdomain.DefineDynamicAssembly(appname, AssemblyBuilderAccess.Save, ".");
emodule = appbuild.DefineDynamicModule(filename + "_module", io.GetOutputFilename(), io.getGenDebug());
Guid g = System.Guid.Empty;
if (io.getGenDebug()) srcdoc = emodule.DefineDocument(ifile, g, g, g);
}