示例#1
0
        public override string Display()
        {
            StringBuilder funcDef = new StringBuilder();

            funcDef.Append($"func {this.Name}(");

            DefsAndRefsStream    defsAndRefsStream = DefsAndRefsStream.GetInstance();
            List <ParamTableRow> paramTableRows    = defsAndRefsStream.GetParameterTableRowsFromOffset(this.ParamsListIndex);

            MethodDefSignature method = this.GetBlobStream().GetMethodDefValue(this.Signature);

            for (var i = 0; i < paramTableRows.Count; i++)
            {
                ParamTableRow paramTableRow = paramTableRows[i];

                if (i < method.ParameterTypes.Count)
                {
                    ParameterType parameterType = method.ParameterTypes[i];
                    funcDef.Append($"{(i == 0 ? "" : ",")} {parameterType.Type.ToString()} {paramTableRow.Display()}");
                }
                else
                {
                    funcDef.Append($"{(i == 0 ? "" : ",")}{paramTableRow.Display()}");
                }
            }

            funcDef.Append($") -> {method.ReturnType.Type.ToString()}");
            return(funcDef.ToString());
        }
        public override string Display()
        {
            DefsAndRefsStream defsAndRefsStream = DefsAndRefsStream.GetInstance();
            StringBuilder     classFormat       = new StringBuilder();

            classFormat.Append($"{this.Namespace}.{this.Name}\n");
            foreach (var methodTableRow in defsAndRefsStream.GetMethodTableRowsFromTypeDef(this))
            {
                classFormat.Append($"\t {methodTableRow.Display()}\n");
            }
            return(classFormat.ToString());
        }
        public string OutputData()
        {
            DefsAndRefsStream defsAndRefsStream = (DefsAndRefsStream)this.Streams[(uint)MetaDataStreamType.DEFS_AND_REFS];
            StringBuilder     builder           = new StringBuilder();

            foreach (var tableRow in defsAndRefsStream.TableRows[MetaDataTableType.TypeDef])
            {
                builder.AppendLine(tableRow.Display());
            }

            return(builder.ToString());
        }