Esempio n. 1
0
        public string GetFullName()
        {
            string fullname = Name;

            if (DefType == XDefType.Root)
            {
                fullname = SubDef.GetFullName();
            }

            if (DefType == XDefType.Namespace)
            {
                fullname += "." + SubDef.GetFullName();
            }

            if (GenericCount != null)
            {
                fullname += "`" + GenericCount.Value.ToString();
            }

            if (Generics != null)
            {
                fullname += "<" + String2.Join(",", Generics.Select(g => g.GetFullName())) + ">";
            }

            if (Arrays != null)
            {
                fullname += Arrays;
            }
            //fullname += "[" + string.Join(",", Arrays.Select(g => g.GetFullName())) + "]";

            // nested classes
            if (DefType == XDefType.Class && SubDef != null)
            {
                fullname += "/" + SubDef.GetFullName();
            }

            if (Remains != null)
            {
                fullname += Remains;
            }

            if (Mods != null)
            {
                fullname += Mods;
            }

            return(fullname);
        }
Esempio n. 2
0
        public string GetShortName()
        {
            // decompiler calls this to get name of class

            // this method calls GetShortName to get short name for generics

            XDef def = this;

            if (DefType != XDefType.Class)
            {
                while (true)
                {
                    if (def.SubDef == null)
                    {
                        break;
                    }

                    def = def.SubDef;
                }
            }

            Debug.Assert(def.DefType == XDefType.Class);

            string shortName = def.Name;

            if (def.Generics != null)
            {
                shortName += "<" + String2.Join(",", def.Generics.Select(g => g.GetShortName())) + ">";
            }

            if (def.Arrays != null)
            {
                shortName += def.Arrays;
            }

            return(shortName);
        }