public virtual void WriteTypeDeclarationsOnly(TypeDefinition member, IWriterContextService writerContextService)
 {
     this.writerContextService = writerContextService;
     this.writerContext        = writerContextService.GetWriterContext(member, Language);
     this.currentWritingInfo   = new WritingInfo(member);
     WriteTypeDeclarationsOnlyInternal(member);
 }
        protected void UpdateWritingInfo(WriterContext writerContext, WritingInfo writingInfo)
        {
            foreach (MethodSpecificContext methodContext in writerContext.MethodContexts.Values)
            {
                if (methodContext != null)
                {
                    writingInfo.ControlFlowGraphs.Add(methodContext.Method, methodContext.ControlFlowGraph);
                    writingInfo.MethodsVariableDefinitionToNameMap.Add(methodContext.Method, methodContext.VariableDefinitionToNameMap);
                }
            }

            foreach (IMemberDefinition memberWithExceptionsWhileDecompiling in writerContext.TypeContext.ExceptionWhileDecompiling)
            {
                if (!writingInfo.MembersWithExceptions.Contains(memberWithExceptionsWhileDecompiling.MetadataToken.ToUInt32()))
                {
                    writingInfo.MembersWithExceptions.Add(memberWithExceptionsWhileDecompiling.MetadataToken.ToUInt32());
                }
            }

            writingInfo.AutoImplementedProperties.UnionWith(writerContext.TypeContext.AutoImplementedProperties);
            writingInfo.AutoImplementedEvents.UnionWith(writerContext.TypeContext.AutoImplementedEvents);
            foreach (GeneratedMethod generatedFilterMethod in writerContext.TypeContext.GeneratedFilterMethods)
            {
                writingInfo.GeneratedFilterMethods.Add(generatedFilterMethod.Method);
            }
        }
Exemple #3
0
 public virtual void WriteTypeDeclarationsOnly(TypeDefinition member, IWriterContextService writerContextService, bool writeDocumentation, bool showCompilerGeneratedMembers = false)
 {
     this.writerContextService = writerContextService;
     this.writerContext        = writerContextService.GetWriterContext(member, Language);
     this.currentWritingInfo   = new WritingInfo(member);
     WriteTypeDeclarationsOnlyInternal(member, writeDocumentation, showCompilerGeneratedMembers);
 }
 public virtual void WriteBody(IMemberDefinition member, IWriterContextService writerContextService)
 {
     this.writerContextService = writerContextService;
     this.currentWritingInfo   = new WritingInfo(member);
     this.writingInfos         = new List <WritingInfo>();
     this.writingInfos.Add(this.currentWritingInfo);
     this.writerContext = writerContextService.GetWriterContext(member, Language);
     WriteBodyInternal(member);
 }
        public virtual List <WritingInfo> Write(IMemberDefinition member, IWriterContextService writerContextService)
        {
            this.writerContextService = writerContextService;
            this.writerContext        = writerContextService.GetWriterContext(member, Language);

            if (member is TypeDefinition)
            {
                this.CurrentType = member as TypeDefinition;
            }

            this.currentWritingInfo = new WritingInfo(member);
            UpdateWritingInfo(this.writerContext, this.currentWritingInfo);
            this.writingInfos = new List <WritingInfo>();
            this.writingInfos.Add(this.currentWritingInfo);

            WriteInternal(member);

            return(writingInfos);
        }
Exemple #6
0
        public virtual List <WritingInfo> Write(IMemberDefinition member, IWriterContextService writerContextService, bool writeDocumentation, bool showCompilerGeneratedMembers = false)
        {
            this.writerContextService = writerContextService;
            this.writerContext        = writerContextService.GetWriterContext(member, Language);

            if (member is TypeDefinition)
            {
                this.CurrentType = member as TypeDefinition;
            }

            this.currentWritingInfo = new WritingInfo(member);
            UpdateWritingInfo(this.writerContext, this.currentWritingInfo);
            this.writingInfos = new List <WritingInfo>();
            this.writingInfos.Add(this.currentWritingInfo);

            WriteInternal(member, writeDocumentation, showCompilerGeneratedMembers);

            return(writingInfos);
        }
        public void WriteTypeDeclaration(TypeDefinition type, IWriterContextService writerContextService)
        {
            this.writerContextService = writerContextService;
            this.writerContext        = writerContextService.GetWriterContext(type, Language);
            this.currentWritingInfo   = new WritingInfo(type);

            WriteAttributes(type, new string[] { "System.Reflection.DefaultMemberAttribute" });

            membersStack.Push(type);
            if (this.ShouldWriteAsDelegate(type))
            {
                WriteDelegate(type);
                WriteLine();
                membersStack.Pop();
                return;
            }

            WriteTypeDeclaration(type);
            WriteLine();

            membersStack.Pop();
        }
        protected void UpdateWritingInfo(WriterContext writerContext, WritingInfo writingInfo)
        {
            foreach (MethodSpecificContext methodContext in writerContext.MethodContexts.Values)
            {
                if (methodContext != null)
                {
                    writingInfo.ControlFlowGraphs.Add(methodContext.Method, methodContext.ControlFlowGraph);
                    writingInfo.MethodsVariableDefinitionToNameMap.Add(methodContext.Method, methodContext.VariableDefinitionToNameMap);
                }
            }

            foreach (IMemberDefinition memberWithExceptionsWhileDecompiling in writerContext.TypeContext.ExceptionWhileDecompiling)
            {
                if (!writingInfo.MembersWithExceptions.Contains(memberWithExceptionsWhileDecompiling.MetadataToken.ToUInt32()))
                {
                    writingInfo.MembersWithExceptions.Add(memberWithExceptionsWhileDecompiling.MetadataToken.ToUInt32());
                }
            }

            writingInfo.AutoImplementedProperties.UnionWith(writerContext.TypeContext.AutoImplementedProperties);
            writingInfo.AutoImplementedEvents.UnionWith(writerContext.TypeContext.AutoImplementedEvents);
            foreach (GeneratedMethod generatedFilterMethod in writerContext.TypeContext.GeneratedFilterMethods)
            {
                writingInfo.GeneratedFilterMethods.Add(generatedFilterMethod.Method);
            }
        }
 public virtual void WriteTypeDeclarationsOnly(TypeDefinition member, IWriterContextService writerContextService, bool writeDocumentation, bool showCompilerGeneratedMembers = false)
 {
     this.writerContextService = writerContextService;
     this.writerContext = writerContextService.GetWriterContext(member, Language);
     this.currentWritingInfo = new WritingInfo(member);
     WriteTypeDeclarationsOnlyInternal(member, writeDocumentation, showCompilerGeneratedMembers);
 }
        public void WriteTypeDeclaration(TypeDefinition type, IWriterContextService writerContextService, bool showCompilerGeneratedMembers = false)
        {
            this.writerContextService = writerContextService;
            this.writerContext = writerContextService.GetWriterContext(type, Language);
            this.currentWritingInfo = new WritingInfo(type);

            WriteAttributes(type, new string[] { "System.Reflection.DefaultMemberAttribute" });

            membersStack.Push(type);
            if (type.IsDelegate())
            {
                WriteDelegate(type);
                WriteLine();
                membersStack.Pop();
                return;
            }

            WriteTypeDeclaration(type);
            WriteLine();

            membersStack.Pop();
        }
 public virtual void WriteBody(IMemberDefinition member, IWriterContextService writerContextService)
 {
     this.writerContextService = writerContextService;
     this.currentWritingInfo = new WritingInfo(member);
     this.writingInfos = new List<WritingInfo>();
     this.writingInfos.Add(this.currentWritingInfo);
     this.writerContext = writerContextService.GetWriterContext(member, Language);
     WriteBodyInternal(member);
 }
        public virtual List<WritingInfo> Write(IMemberDefinition member, IWriterContextService writerContextService, bool writeDocumentation, bool showCompilerGeneratedMembers = false)
        {
            this.writerContextService = writerContextService;
            this.writerContext = writerContextService.GetWriterContext(member, Language);

            if (member is TypeDefinition)
            {
                this.CurrentType = member as TypeDefinition;
            }

            this.currentWritingInfo = new WritingInfo(member);
            UpdateWritingInfo(this.writerContext, this.currentWritingInfo);
            this.writingInfos = new List<WritingInfo>();
            this.writingInfos.Add(this.currentWritingInfo);

            WriteInternal(member, writeDocumentation, showCompilerGeneratedMembers);

            return writingInfos;
        }