当前位置: 首页>>代码示例>>C#>>正文


C# IProperty.ToString方法代码示例

本文整理汇总了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) {

            }
        }
开发者ID:maresja1,项目名称:SDenc,代码行数:28,代码来源:EnCManager.cs

示例2: WriteProperty

 public void WriteProperty(IProperty property)
 {
     sb.Append(property.ToString());
 }
开发者ID:kingzog,项目名称:4vlib,代码行数:4,代码来源:TextExporter.cs

示例3: WriteProperty

 public void WriteProperty(IProperty property)
 {
     Console.WriteLine(property.ToString());
 }
开发者ID:kingzog,项目名称:4vlib,代码行数:4,代码来源:ConsoleExporter.cs

示例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);
            }
        }
开发者ID:maresja1,项目名称:SDenc,代码行数:42,代码来源:DeltaBuilder.cs


注:本文中的IProperty.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。