Пример #1
0
        public TypeDeclaration MakeUnrooted()
        {
            if (IsUnrooted)
            {
                return(this);
            }

            TypeDeclaration unrooted = UnrootedFactory();

            unrooted.unrootedName     = ToFullyQualifiedName(false);
            unrooted.fullUnrootedName = ToFullyQualifiedName(true);
            unrooted.Kind             = Kind;
            unrooted.Inheritance.AddRange(Inheritance);
            unrooted.Members.AddRange(Members);
            unrooted.IsObjC     = IsObjC;
            unrooted.IsFinal    = IsFinal;
            unrooted.IsUnrooted = true;
            unrooted.Name       = Name;
            unrooted.Access     = Access;
            unrooted.Module     = Module.MakeUnrooted();
            unrooted.Generics.AddRange(Generics);
            CompleteUnrooting(unrooted);
            return(unrooted);
        }
Пример #2
0
        protected virtual void GatherXObjects(List <XObject> xobjects)
        {
            XElement generics = Generics.ToXElement();

            if (generics != null)
            {
                xobjects.Add(generics);
            }
            xobjects.Add(new XAttribute("kind", ToString(Kind)));
            xobjects.Add(new XAttribute("name", fullUnrootedName));
            xobjects.Add(new XAttribute("module", Module.Name));
            xobjects.Add(new XAttribute("accessibility", TypeDeclaration.ToString(Access)));
            xobjects.Add(new XAttribute("isObjC", IsObjC ? "true" : "false"));
            xobjects.Add(new XAttribute("isFinal", IsFinal ? "true" : "false"));
            xobjects.Add(new XAttribute("isDeprecated", IsDeprecated ? "true" : "false"));
            xobjects.Add(new XAttribute("isUnavailable", IsUnavailable ? "true" : "false"));
            // DO NOT INCLUDE Inner[Classes,Structs,Enums]
            List <XObject> memcontents = new List <XObject> (Members.Select(m => m.ToXElement()));

            xobjects.Add(new XElement("members", memcontents.ToArray()));
            List <XObject> inherits = new List <XObject> (Inheritance.Select(i => i.ToXElement()));

            xobjects.Add(new XElement("inherits", inherits.ToArray()));
        }
        protected override XElement MakeXElement()
        {
            XElement theFunc = new XElement("func",
                                            new XAttribute("name", Name),
                                            new XAttribute("accessibility", TypeDeclaration.ToString(Access)),
                                            new XAttribute("returnType", ReturnTypeName),
                                            new XAttribute("isProperty", BoolString(IsProperty)),
                                            new XAttribute("isStatic", BoolString(IsStatic)),
                                            new XAttribute("isFinal", BoolString(IsFinal)),
                                            new XAttribute("isDeprecated", BoolString(IsDeprecated)),
                                            new XAttribute("isUnavailable", BoolString(IsUnavailable)),
                                            new XAttribute("isOptional", BoolString(IsOptional)),
                                            new XAttribute("operatorKind", OperatorType.ToString()),
                                            new XAttribute("hasThrows", BoolString(HasThrows)),
                                            new XAttribute("isRequired", BoolString(IsRequired)),
                                            new XAttribute("isConvenienceInit", BoolString(IsConvenienceInit)),
                                            new XElement("parameterlists", MakeParamListXElement()));

            if (!String.IsNullOrEmpty(ObjCSelector))
            {
                theFunc.Add(new XAttribute("objcSelector", ObjCSelector));
            }
            return(theFunc);
        }
Пример #4
0
 protected virtual void CompleteUnrooting(TypeDeclaration unrooted)
 {
 }