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


C# Workspace.GetStream方法代码示例

本文整理汇总了C#中Workspace.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# Workspace.GetStream方法的具体用法?C# Workspace.GetStream怎么用?C# Workspace.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Workspace的用法示例。


在下文中一共展示了Workspace.GetStream方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendHeaders

        private void AppendHeaders(Workspace workspace)
        {
            TablesHeap tablesHeap = workspace.GetStream<TablesHeap>();

            foreach (var keypair in workspace.Members)
            {
                tablesHeap._binWriter.Write(keypair.Value.Length);
            }
        }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:9,代码来源:MetaDataWriter.cs

示例2: AppendMembers

 private void AppendMembers(Workspace workspace)
 {
     TablesHeap tablesHeap = workspace.GetStream<TablesHeap>();
     foreach (var keypair in workspace.Members)
     {
         foreach (MetaDataMemberInfo memberInfo in keypair.Value)
         {
             AppendMetaDataRow(tablesHeap, memberInfo.Instance.MetaDataRow);
         }
     }
 }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:11,代码来源:MetaDataWriter.cs

示例3: AppendCode

        private void AppendCode(Workspace workspace, MethodBody methodBody, BinaryWriter writer)
        {
            foreach (MSILInstruction instruction in methodBody.Instructions)
            {
                writer.Write(instruction.OpCode.Bytes);

                // TODO: support all instructions
                if (instruction.Operand is string)
                {
                    uint offset = workspace.GetStream<UserStringsHeap>().GetStringOffset(instruction.Operand as string);
                    offset += 0x70000000;
                    instruction.OperandBytes = BitConverter.GetBytes(offset);
                }
                if (instruction.Operand is MetaDataMember)
                {
                    instruction.OperandBytes = BitConverter.GetBytes((instruction.Operand as MetaDataMember).MetaDataToken);
                }

                if (instruction.OperandBytes != null)
                    writer.Write(instruction.OperandBytes);
            }
        }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:22,代码来源:MsilMethodBuilder.cs

示例4: GetStringIndex

 private ValueType GetStringIndex(Workspace workspace, string str)
 {
     StringsHeap stringsHeap = workspace.GetStream<StringsHeap>();
     return GetHeapOffset(stringsHeap, stringsHeap.GetStringOffset(str));
 }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:5,代码来源:MetaDataWriter.cs

示例5: GetGuidIndex

 private ValueType GetGuidIndex(Workspace workspace, Guid guid)
 {
     GuidHeap guidHeap = workspace.GetStream<GuidHeap>();
     return GetHeapOffset(guidHeap, guidHeap.GetGuidOffset(guid));
 }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:5,代码来源:MetaDataWriter.cs

示例6: UpdateMetaDataRows

        private void UpdateMetaDataRows(Workspace workspace)
        {
            TablesHeap tablesHeap = workspace.GetStream<TablesHeap>();
            foreach (var table in workspace.Members)
            {
                foreach (MetaDataMemberInfo member in table.Value)
                {
                    switch (table.Key)
                    {
                        case MetaDataTableType.Assembly: UpdateAssemblyDef(workspace, member.Instance as AssemblyDefinition); break;
                        case MetaDataTableType.AssemblyRef: UpdateAssemblyRef(workspace, member.Instance as AssemblyReference); break;
                        case MetaDataTableType.ClassLayout: UpdateClassLayout(workspace, member.Instance as ClassLayout); break;
                        case MetaDataTableType.Constant: UpdateConstant(workspace, member.Instance as Constant); break;
                        case MetaDataTableType.CustomAttribute: UpdateCustomAttribute(workspace, member.Instance as CustomAttribute); break;
                        case MetaDataTableType.DeclSecurity: UpdateSecurityDecl(workspace, member.Instance as SecurityDeclaration); break;
                        case MetaDataTableType.EncLog: ; break;
                        case MetaDataTableType.EncMap: ; break;
                        case MetaDataTableType.Event: UpdateEventDef(workspace, member.Instance as EventDefinition); break;
                        case MetaDataTableType.EventMap: UpdateEventMap(workspace, member.Instance as EventMap); break;
                        case MetaDataTableType.EventPtr: ; break;
                        case MetaDataTableType.ExportedType: ; break;
                        case MetaDataTableType.Field: UpdateFieldDef(workspace, member.Instance as FieldDefinition); break;
                        case MetaDataTableType.FieldLayout: UpdateFieldLayout(workspace, member.Instance as FieldLayout); break;
                        case MetaDataTableType.FieldMarshal: UpdateFieldMarshal(workspace, member.Instance as FieldMarshal); break;
                        case MetaDataTableType.FieldPtr: ; break;
                        case MetaDataTableType.FieldRVA: UpdateFieldRva(workspace, member.Instance as FieldRVA); break;
                        case MetaDataTableType.File: ; break;
                        case MetaDataTableType.GenericParam: ; break;
                        case MetaDataTableType.GenericParamConstraint: ; break;
                        case MetaDataTableType.ImplMap: UpdatePInvokeImpl(workspace, member.Instance as PInvokeImplementation); break;
                        case MetaDataTableType.InterfaceImpl: UpdateInterfaceImpl(workspace, member.Instance as InterfaceImplementation); break;
                        case MetaDataTableType.ManifestResource: ; break;
                        case MetaDataTableType.MemberRef: UpdateMemberRef(workspace, member.Instance as MemberReference); break;
                        case MetaDataTableType.Method: UpdateMethodDef(workspace, member.Instance as MethodDefinition); break;
                        case MetaDataTableType.MethodImpl: UpdateMethodImpl(workspace, member.Instance as MethodImplementation); break;
                        case MetaDataTableType.MethodPtr: ; break;
                        case MetaDataTableType.MethodSemantics: UpdateMethodSemantics(workspace, member.Instance as MethodSemantics); break;
                        case MetaDataTableType.MethodSpec: UpdateMethodSpec(workspace, member.Instance as MethodSpecification); break;
                        case MetaDataTableType.Module: UpdateModule(workspace, member.Instance as ModuleDefinition); break;
                        case MetaDataTableType.ModuleRef: UpdateModuleRef(workspace, member.Instance as ModuleReference); break;
                        case MetaDataTableType.NestedClass: ; break;
                        case MetaDataTableType.Param: UpdateParamDef(workspace, member.Instance as ParameterDefinition); break;
                        case MetaDataTableType.ParamPtr: UpdateParamPtr(workspace, member.Instance as ParamPtr); break;
                        case MetaDataTableType.Property: UpdatePropertyDef(workspace, member.Instance as PropertyDefinition); break;
                        case MetaDataTableType.PropertyMap: UpdatePropertyMap(workspace, member.Instance as PropertyMap); break;
                        case MetaDataTableType.PropertyPtr: UpdatePropertyPtr(workspace, member.Instance as PropertyPtr); break;
                        case MetaDataTableType.StandAloneSig: UpdateStandAloneSig(workspace, member.Instance as StandAloneSignature); break;
                        case MetaDataTableType.TypeDef: UpdateTypeDef(workspace, member.Instance as TypeDefinition); break;
                        case MetaDataTableType.TypeRef: UpdateTypeRef(workspace, member.Instance as TypeReference); break;
                        case MetaDataTableType.TypeSpec: UpdateTypeSpec(workspace, member.Instance as TypeSpecification); break;

                    }

                }
            }
        }
开发者ID:Rex-Hays,项目名称:GNIDA,代码行数:56,代码来源:MetaDataWriter.cs


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