Esempio n. 1
0
        public void ConnectMetadata(IEnumerable <Ui5Interface> allInterfaces)
        {
            if (Metadata == null)
            {
                return;
            }

            if (Metadata != null)
            {
                Ui5Interface baseinterface = allInterfaces.FirstOrDefault(x => x.fullname == Metadata.extends);
                if (baseinterface == null)
                {
                    Metadata.extends = null;
                }
            }
        }
Esempio n. 2
0
        public void CreateMetadata(string suffix = "Metadata")
        {
            if (ui5Metadata == null)
            {
                return;
            }

            // Create Interface for initialization
            if (ui5Metadata.properties == null && ui5Metadata.events == null)
            {
                return;
            }

            // Create Metadata
            if (Metadata == null)
            {
                Metadata = new Ui5Interface
                {
                    properties = ui5Metadata.properties,
                    name       = fullname + suffix,
                    extends    = (extends != null ? extends + suffix : null),
                    events     = ui5Metadata.events ?? null
                };
                parentNamespace?.Content.Add(Metadata);
                Metadata.parentNamespace = parentNamespace;
            }

            // update constructor props
            var param = constructor.parameters.FirstOrDefault(x => x.name == "mSettings");

            if (param != null)
            {
                param.type = Metadata.fullname;
            }

            var extendmethod = methods.FirstOrDefault(x => x.name == "extend");

            if (extendmethod != null)
            {
                var classinfo = extendmethod.parameters.FirstOrDefault(x => x.name == "oClassInfo");
                if (classinfo != null)
                {
                    classinfo.type += "|" + Metadata.fullname;
                }
            }
        }