Exemplo n.º 1
0
        public TypeTreeViewItem(IDocumentService documentService, TypeDef type)
        {
            this.documentService = documentService;
            this.Type            = type;

            var texts = new List <TextRun>();

            DecompileFormatUtil.AddTexts(this.Type, texts);
            this.Texts = texts;
        }
Exemplo n.º 2
0
        private IReadOnlyList <TextRun> BuildTexts()
        {
            var texts = new List <TextRun>();

            texts.Add(new TextRun(this.Property.Name.String, this.Property.PropertySig.HasThis ? "d-iproperty" : "d-sproperty"));
            texts.Add(new TextRun(" : "));

            DecompileFormatUtil.AddTexts(this.Property.PropertySig.RetType, texts);

            return(texts);
        }
Exemplo n.º 3
0
        private IReadOnlyList <TextRun> BuildTexts()
        {
            var texts = new List <TextRun>();

            texts.Add(new TextRun(this.Method.Name.String, this.Method.IsStatic ? "d-smethod" : "d-imethod"));
            texts.Add(new TextRun("("));
            var isFirst = true;

            foreach (var param in this.Method.Parameters)
            {
                if (!param.IsNormalMethodParameter)
                {
                    continue;
                }

                if (isFirst)
                {
                    isFirst = false;
                }
                else
                {
                    texts.Add(new TextRun(", "));
                }


                var type = param.Type;
                if (type.IsByRef)
                {
                    if (!param.ParamDef.IsIn && param.ParamDef.IsOut)
                    {
                        texts.Add(new TextRun("out ", "d-keyword"));
                    }
                    else
                    {
                        texts.Add(new TextRun("ref ", "d-keyword"));
                    }

                    type = type.Next;
                }

                DecompileFormatUtil.AddTexts(type, texts);
            }
            texts.Add(new TextRun(") : "));

            DecompileFormatUtil.AddTexts(Method.ReturnType, texts);

            return(texts);
        }
Exemplo n.º 4
0
        private IReadOnlyList <TextRun> BuildTexts()
        {
            var texts = new List <TextRun>();

            string cssClass;

            if (this.Field.DeclaringType.IsEnum)
            {
                cssClass = "d-efield";
            }
            else
            {
                cssClass = this.Field.FieldSig.HasThis ? "d-ifield" : "d-sfield";
            }

            texts.Add(new TextRun(this.Field.Name.String, cssClass));
            texts.Add(new TextRun(" : "));

            DecompileFormatUtil.AddTexts(this.Field.FieldSig.Type, texts);

            return(texts);
        }