本文整理汇总了C#中IProperty.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IProperty.ToString方法的具体用法?C# IProperty.ToString怎么用?C# IProperty.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProperty
的用法示例。
在下文中一共展示了IProperty.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: regenMovedSymbolsProperty
private void regenMovedSymbolsProperty(IProperty property, SymbolWriterClass emitter)
{
PropertyDefinition targtProp, targtPropOld;
MethodDefinition targtMetSet, targtMetOldSet, targtMetGet, targtMetOldGet;
// Find appropriete new version of method in new assembly.
targtProp = MetadataManager.FindProperty(ResourceManager.NewAssembly,
ResourceManager.NewAssemblyName, property);
if (targtProp == null) throw new TranslatingException("Property " + property.ToString() + " could not be found in debugged module");
// Find appropriete original version of method in running assembly.
targtPropOld = MetadataManager.FindProperty(ResourceManager.OldAssembly,
ResourceManager.CurrentModule.Name, property);
if (targtPropOld == null) throw new TranslatingException("Property "+property.ToString()+" could not be found in emitted module");
targtMetGet = targtProp.GetMethod;
targtMetSet = targtProp.SetMethod;
targtMetOldGet = targtPropOld.GetMethod;
targtMetOldSet = targtPropOld.SetMethod;
try {
if (targtMetGet != null)
emitter.EmitMethod(targtMetOldGet.MetadataToken.ToUInt32(), targtMetGet.MetadataToken.ToUInt32());
if (targtMetSet != null)
emitter.EmitMethod(targtMetOldSet.MetadataToken.ToUInt32(), targtMetSet.MetadataToken.ToUInt32());
} catch (COMException e) {
}
}
示例2: WriteProperty
public void WriteProperty(IProperty property)
{
sb.Append(property.ToString());
}
示例3: WriteProperty
public void WriteProperty(IProperty property)
{
Console.WriteLine(property.ToString());
}
示例4: ChangeProperty
/// <summary>
/// Change IL code and metadata for property.
/// </summary>
/// <param name="property">Interaface with info abour property.</param>
/// <param name="isGetter">Determines whether it is getter method for property.</param>
public void ChangeProperty(IProperty property, bool isGetter)
{
// Method RVA is offset to start of byte buffer
uint RVA = (uint)dIL.Count + 4;
PropertyDefinition targtProp, targtPropOld;
MethodDefinition targtMet, targtMetOld;
// Find appropriete new version of method in new assembly.
targtProp = Manager.MetadataManager.FindProperty(Manager.ResourceManager.NewAssembly,
Manager.ResourceManager.NewAssemblyName, property);
if (targtProp == null) new TranslatingException("Property " + property.ToString() + " could not be found in emitted module");
// Find appropriete original version of method in running assembly.
targtPropOld = Manager.MetadataManager.FindProperty(Manager.ResourceManager.OldAssembly,
Manager.ResourceManager.CurrentModule.Name, property);
if (targtPropOld == null) new TranslatingException("Property " + property.ToString() + " could not be found in debugged module");
targtMet = (isGetter ? targtProp.GetMethod : targtProp.SetMethod);
targtMetOld = (isGetter ? targtPropOld.GetMethod : targtPropOld.SetMethod);
SequencePointRemapper remapper = genSequencePointRemapper(targtMetOld, targtMet);
// Translate tokens in methods IL code.
MethodTranslator translator = new MethodTranslator(this);
Dictionary<int, int> placeholder;
MethodDescriptor log = translator.TranslateMethod(targtMet, targtMetOld, remapper, out placeholder);
log.newRva = RVA;
// Set method RVA.
Manager.MetadataManager.OldEmitter.CorMetaDataEmit.SetRVA(targtMetOld.MetadataToken.ToUInt32(), RVA);
// Store methods IL to buffer
dIL.AddRange(log.codeIL);
if (SymbolWriter != null) {
SymbolWriter.EmitMethod(log.destToken, log.srcToken, placeholder);
}
}