コード例 #1
0
		void RewriteClass(XamlContext ctx, XElement elem) {
			var type = elem.Annotation<XamlType>();
			if (type == null || type.ResolvedType == null)
				return;

			var typeDef = type.ResolvedType.ResolveTypeDef();
			var comparer = new AssemblyNameComparer(AssemblyNameComparerFlags.All);
			if (typeDef == null || !comparer.Equals(typeDef.DefinitionAssembly, ctx.Module.Assembly))
				return;

			var newType = typeDef.BaseType;
			var xamlType = new XamlType(newType.DefinitionAssembly, newType.ReflectionNamespace, newType.Name);
			xamlType.ResolveNamespace(elem, ctx);

			elem.Name = xamlType.ToXName(ctx);

			var attrName = ctx.GetXamlNsName("Class", elem);

			var attrs = elem.Attributes().ToList();
			if (typeDef.IsNotPublic) {
				var classModifierName = ctx.GetXamlNsName("ClassModifier", elem);
				attrs.Insert(0, new XAttribute(classModifierName, ctx.BamlDecompilerOptions.InternalClassModifier));
			}
			attrs.Insert(0, new XAttribute(attrName, type.ResolvedType.ReflectionFullName));
			elem.ReplaceAttributes(attrs);
		}
コード例 #2
0
ファイル: PropertyHandler.cs プロジェクト: zuluck2004/ILSpy
        public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (PropertyRecord)((BamlRecordNode)node).Record;

            var elemType = parent.Xaml.Element.Annotation <XamlType>();
            var xamlProp = ctx.ResolveProperty(record.AttributeId);
            var value    = XamlUtils.Escape(record.Value);

            parent.Xaml.Element.Add(ConstructXAttribute());

            return(null);

            XAttribute ConstructXAttribute()
            {
                if (xamlProp.IsAttachedTo(elemType))
                {
                    return(new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, true), value));
                }

                if (xamlProp.PropertyName == "Name" && elemType.ResolvedType.GetDefinition()?.ParentModule.IsMainModule == true)
                {
                    return(new XAttribute(ctx.GetXamlNsName("Name"), value));
                }

                return(new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, false), value));
            }
        }
コード例 #3
0
        public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record   = (PropertyTypeReferenceRecord)((BamlRecordNode)node).Record;
            var attr     = ctx.ResolveProperty(record.AttributeId);
            var type     = ctx.ResolveType(record.TypeId);
            var typeName = ctx.ToString(parent.Xaml, type);

            var elem = new BamlElement(node);

            var elemAttr = ctx.ResolveProperty(record.AttributeId);

            elem.Xaml = new XElement(elemAttr.ToXName(ctx, null));

            elem.Xaml.Element.AddAnnotation(elemAttr);
            parent.Xaml.Element.Add(elem.Xaml.Element);

            var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));

            typeElem.AddAnnotation(ctx.ResolveType(0xfd4d));             // Known type - TypeExtension
            typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
            elem.Xaml.Element.Add(typeElem);

            elemAttr.DeclaringType.ResolveNamespace(elem.Xaml, ctx);
            elem.Xaml.Element.Name = elemAttr.ToXName(ctx, null);

            return(elem);
        }
コード例 #4
0
ファイル: XClassRewritePass.cs プロジェクト: xornand/dnSpy
        void RewriteClass(XamlContext ctx, XElement elem)
        {
            var type = elem.Annotation <XamlType>();

            if (type == null || type.ResolvedType == null)
            {
                return;
            }

            var typeDef  = type.ResolvedType.ResolveTypeDef();
            var comparer = new AssemblyNameComparer(AssemblyNameComparerFlags.All);

            if (typeDef == null || !comparer.Equals(typeDef.DefinitionAssembly, ctx.Module.Assembly))
            {
                return;
            }

            var newType  = typeDef.BaseType;
            var xamlType = new XamlType(newType.DefinitionAssembly, newType.ReflectionNamespace, newType.Name);

            xamlType.ResolveNamespace(elem, ctx);

            elem.Name = xamlType.ToXName(ctx);

            var attrName = ctx.GetXamlNsName("Class", elem);

            var attrs = elem.Attributes().ToList();

            attrs.Insert(0, new XAttribute(attrName, type.ResolvedType.ReflectionFullName));
            elem.ReplaceAttributes(attrs);
        }
コード例 #5
0
		public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (DefAttributeRecord)((BamlRecordNode)node).Record;

			var attrName = ctx.ResolveString(record.NameId);
			parent.Xaml.Element.Add(new XAttribute(ctx.GetXamlNsName(attrName), record.Value));

			return null;
		}
コード例 #6
0
        public void Run(XamlContext ctx, XDocument document)
        {
            var xClass = document.Root.Elements().First().Attribute(ctx.GetXamlNsName("Class"));

            if (xClass == null)
            {
                return;
            }

            var type = ctx.Module.Find(xClass.Value, true);

            if (type == null)
            {
                return;
            }

            var wbAsm = ctx.Module.CorLibTypes.AssemblyRef.Version == new Version(2, 0, 0, 0) ?
                        new AssemblyNameInfo("WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").ToAssemblyRef() :
                        new AssemblyNameInfo("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").ToAssemblyRef();
            var ifaceRef = new TypeRefUser(ctx.Module, "System.Windows.Markup", "IComponentConnector", wbAsm);
            var iface    = ctx.Module.Context.Resolver.ResolveThrow(ifaceRef);

            var connect = iface.FindMethod("Connect");

            foreach (MethodDef method in type.Methods)
            {
                if (Impl(method, connect))
                {
                    connect = method;
                    iface   = null;
                    break;
                }
            }
            if (iface != null)
            {
                return;
            }

            Dictionary <int, Action <XamlContext, XElement> > connIds = null;

            try {
                connIds = ExtractConnectionId(ctx, connect);
            }
            catch {
            }

            if (connIds == null)
            {
                var msg = dnSpy_BamlDecompiler_Resources.Error_IComponentConnectorConnetCannotBeParsed;
                document.Root.AddBeforeSelf(new XComment(string.Format(msg, type.ReflectionFullName)));
                return;
            }

            foreach (var elem in document.Elements())
            {
                ProcessElement(ctx, elem, connIds);
            }
        }
コード例 #7
0
            public void Callback(XamlContext ctx, XElement elem)
            {
                var xName = ctx.GetXamlNsName("Name");

                if (elem.Attribute("Name") == null && elem.Attribute(xName) == null)
                {
                    elem.Add(new XAttribute(xName, FieldName));
                }
            }
コード例 #8
0
		public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (DefAttributeKeyTypeRecord)((BamlRecordNode)node).Record;
			var type = ctx.ResolveType(record.TypeId);
			var typeName = ctx.ToString(parent.Xaml, type);
			var key = (XamlResourceKey)node.Annotation;

			var bamlElem = new BamlElement(node);
			bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
			parent.Xaml.Element.Add(bamlElem.Xaml.Element);

			var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
			typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
			typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
			bamlElem.Xaml.Element.Add(typeElem);

			key.KeyElement = bamlElem;

			return bamlElem;
		}
コード例 #9
0
        public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (DefAttributeRecord)((BamlRecordNode)node).Record;

            var attrName = ctx.ResolveString(record.NameId);

            parent.Xaml.Element.Add(new XAttribute(ctx.GetXamlNsName(attrName), record.Value));

            return(null);
        }
コード例 #10
0
		public void Run(XamlContext ctx, XDocument document) {
			key = ctx.GetXamlNsName("Key");

			bool doWork;
			do {
				doWork = false;
				foreach (var elem in document.Elements()) {
					doWork |= ProcessElement(ctx, elem);
				}
			} while (doWork);
		}
コード例 #11
0
		public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (LiteralContentRecord)((BamlRecordNode)node).Record;

			var elem = new XElement(ctx.GetXamlNsName("XData", parent.Xaml));
			var content = XElement.Parse(record.Value);
			elem.Add(content);

			parent.Xaml.Element.Add(elem);

			return null;
		}
コード例 #12
0
		public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (DefAttributeKeyStringRecord)((BamlRecordNode)node).Record;
			var key = (XamlResourceKey)node.Annotation;

			var bamlElem = new BamlElement(node);
			bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
			parent.Xaml.Element.Add(bamlElem.Xaml.Element);
			bamlElem.Xaml.Element.Value = ctx.ResolveString(record.ValueId);
			key.KeyElement = bamlElem;

			return bamlElem;
		}
コード例 #13
0
		public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (KeyElementStartRecord)((BamlBlockNode)node).Header;
			var key = (XamlResourceKey)node.Annotation;

			var bamlElem = new BamlElement(node);
			bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
			parent.Xaml.Element.Add(bamlElem.Xaml.Element);
			key.KeyElement = bamlElem;
			base.Translate(ctx, node, bamlElem);

			return bamlElem;
		}
コード例 #14
0
        void RewriteClass(XamlContext ctx, XElement elem)
        {
            var type = elem.Annotation <XamlType>();

            if (type == null || type.ResolvedType == null)
            {
                return;
            }

            var typeDef = type.ResolvedType.GetDefinition();

            if (typeDef == null || !typeDef.ParentModule.IsMainModule)
            {
                return;
            }

            var newType = typeDef.DirectBaseTypes.First().GetDefinition();

            if (newType == null)
            {
                return;
            }
            var xamlType = new XamlType(newType.ParentModule, newType.ParentModule.FullAssemblyName, newType.Namespace, newType.Name);

            xamlType.ResolveNamespace(elem, ctx);

            elem.Name = xamlType.ToXName(ctx);

            var attrName = ctx.GetXamlNsName("Class", elem);

            var attrs = elem.Attributes().ToList();

            if (typeDef.Accessibility != ICSharpCode.Decompiler.TypeSystem.Accessibility.Public)
            {
                var classModifierName = ctx.GetXamlNsName("ClassModifier", elem);
                attrs.Insert(0, new XAttribute(classModifierName, "internal"));
            }
            attrs.Insert(0, new XAttribute(attrName, type.ResolvedType.FullName));
            elem.ReplaceAttributes(attrs);
        }
コード例 #15
0
        public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record   = (DefAttributeKeyTypeRecord)((BamlRecordNode)node).Record;
            var type     = ctx.ResolveType(record.TypeId);
            var typeName = ctx.ToString(parent.Xaml, type);
            var key      = (XamlResourceKey)node.Annotation;

            var bamlElem = new BamlElement(node);

            bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
            parent.Xaml.Element.Add(bamlElem.Xaml.Element);

            var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));

            typeElem.AddAnnotation(ctx.ResolveType(0xfd4d));             // Known type - TypeExtension
            typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
            bamlElem.Xaml.Element.Add(typeElem);

            key.KeyElement = bamlElem;

            return(bamlElem);
        }
コード例 #16
0
        public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (LiteralContentRecord)((BamlRecordNode)node).Record;

            var elem    = new XElement(ctx.GetXamlNsName("XData", parent.Xaml));
            var content = XElement.Parse(record.Value);

            elem.Add(content);

            parent.Xaml.Element.Add(elem);

            return(null);
        }
コード例 #17
0
ファイル: KeyElementStartHandler.cs プロジェクト: zz110/dnSpy
        public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (KeyElementStartRecord)((BamlBlockNode)node).Header;
            var key    = (XamlResourceKey)node.Annotation;

            var bamlElem = new BamlElement(node);

            bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
            parent.Xaml.Element.Add(bamlElem.Xaml.Element);
            key.KeyElement = bamlElem;
            base.Translate(ctx, node, bamlElem);

            return(bamlElem);
        }
コード例 #18
0
        public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (DefAttributeKeyStringRecord)((BamlRecordNode)node).Record;
            var key    = (XamlResourceKey)node.Annotation;

            var bamlElem = new BamlElement(node);

            bamlElem.Xaml = new XElement(ctx.GetXamlNsName("Key", parent.Xaml));
            parent.Xaml.Element.Add(bamlElem.Xaml.Element);
            bamlElem.Xaml.Element.Value = ctx.ResolveString(record.ValueId);
            key.KeyElement = bamlElem;

            return(bamlElem);
        }
コード例 #19
0
        public void Run(XamlContext ctx, XDocument document)
        {
            key = ctx.GetXamlNsName("Key");

            bool doWork;

            do
            {
                doWork = false;
                foreach (var elem in document.Elements())
                {
                    doWork |= ProcessElement(ctx, elem);
                }
            } while (doWork);
        }
コード例 #20
0
		public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (ConstructorParameterTypeRecord)((BamlRecordNode)node).Record;

			var elem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
			elem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension

			var bamlElem = new BamlElement(node);
			bamlElem.Xaml = elem;
			parent.Xaml.Element.Add(elem);

			var type = ctx.ResolveType(record.TypeId);
			var typeName = ctx.ToString(parent.Xaml, type);
			elem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));

			return bamlElem;
		}
コード例 #21
0
        public void Run(XamlContext ctx, XDocument document)
        {
            var xClass = document.Root.Elements().First().Attribute(ctx.GetXamlNsName("Class"));
            if (xClass == null)
                return;

            var type = ctx.Module.Find(xClass.Value, true);
            if (type == null)
                return;

            var wbAsm = new AssemblyNameInfo("WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").ToAssemblyRef();
            var ifaceRef = new TypeRefUser(ctx.Module, "System.Windows.Markup", "IComponentConnector", wbAsm);
            var iface = ctx.Module.Context.Resolver.ResolveThrow(ifaceRef);

            var connect = iface.FindMethod("Connect");

            foreach (MethodDef method in type.Methods) {
                if (Impl(method, connect)) {
                    connect = method;
                    iface = null;
                    break;
                }
            }
            if (iface != null)
                return;

            Dictionary<int, Action<XamlContext, XElement>> connIds = null;
            try {
                connIds = ExtractConnectionId(ctx, connect);
            }
            catch {
            }

            if (connIds == null) {
                var msg = dnSpy_BamlDecompiler_Resources.Error_IComponentConnectorConnetCannotBeParsed;
                document.Root.AddBeforeSelf(new XComment(string.Format(msg, type.ReflectionFullName)));
                return;
            }

            foreach (var elem in document.Elements()) {
                ProcessElement(ctx, elem, connIds);
            }
        }
コード例 #22
0
        public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var record = (ConstructorParameterTypeRecord)((BamlRecordNode)node).Record;

            var elem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));

            elem.AddAnnotation(ctx.ResolveType(0xfd4d));             // Known type - TypeExtension

            var bamlElem = new BamlElement(node);

            bamlElem.Xaml = elem;
            parent.Xaml.Element.Add(elem);

            var type     = ctx.ResolveType(record.TypeId);
            var typeName = ctx.ToString(parent.Xaml, type);

            elem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));

            return(bamlElem);
        }
コード例 #23
0
		public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (PropertyTypeReferenceRecord)((BamlRecordNode)node).Record;
			var attr = ctx.ResolveProperty(record.AttributeId);
			var type = ctx.ResolveType(record.TypeId);
			var typeName = ctx.ToString(parent.Xaml, type);

			var elem = new BamlElement(node);

			var elemAttr = ctx.ResolveProperty(record.AttributeId);
			elem.Xaml = new XElement(elemAttr.ToXName(ctx, null));

			elem.Xaml.Element.AddAnnotation(elemAttr);
			parent.Xaml.Element.Add(elem.Xaml.Element);

			var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
			typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
			typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
			elem.Xaml.Element.Add(typeElem);

			elemAttr.DeclaringType.ResolveNamespace(elem.Xaml, ctx);
			elem.Xaml.Element.Name = elemAttr.ToXName(ctx, null);

			return elem;
		}
コード例 #24
0
		public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent) {
			var record = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
			var bamlElem = new BamlElement(node);
			object key;
			if (record.IsType) {
				var value = ctx.ResolveType(record.ValueId);

				var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
				typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
				typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), ctx.ToString(parent.Xaml, value)));
				key = typeElem;
			}
			else if (record.IsStatic) {
				string attrName;
				if (record.ValueId > 0x7fff) {
					bool isKey = true;
					short bamlId = (short)-record.ValueId;
					if (bamlId > 232 && bamlId < 464) {
						bamlId -= 232;
						isKey = false;
					}
					else if (bamlId > 464 && bamlId < 467) {
						bamlId -= 231;
					}
					else if (bamlId > 467 && bamlId < 470) {
						bamlId -= 234;
						isKey = false;
					}
					var res = ctx.Baml.KnownThings.Resources(bamlId);
					string name;
					if (isKey)
						name = res.Item1 + "." + res.Item2;
					else
						name = res.Item1 + "." + res.Item3;
					var xmlns = ctx.GetXmlNamespace("http://schemas.microsoft.com/winfx/2006/xaml/presentation");
					attrName = ctx.ToString(parent.Xaml, xmlns.GetName(name));
				}
				else {
					var value = ctx.ResolveProperty(record.ValueId);

					value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
					var xName = value.ToXName(ctx, parent.Xaml);

					attrName = ctx.ToString(parent.Xaml, xName);
				}

				var staticElem = new XElement(ctx.GetXamlNsName("StaticExtension", parent.Xaml));
				staticElem.AddAnnotation(ctx.ResolveType(0xfda6)); // Known type - StaticExtension
				staticElem.Add(new XElement(ctx.GetPseudoName("Ctor"), attrName));
				key = staticElem;
			}
			else
				key = ctx.ResolveString(record.ValueId);

			var extType = ctx.ResolveType(0xfda5);
			var resElem = new XElement(extType.ToXName(ctx));
			resElem.AddAnnotation(extType); // Known type - StaticResourceExtension
			bamlElem.Xaml = resElem;
			parent.Xaml.Element.Add(resElem);

			var attrElem = new XElement(ctx.GetPseudoName("Ctor"));
			attrElem.Add(key);
			resElem.Add(attrElem);

			return bamlElem;
		}
コード例 #25
0
			public void Callback(XamlContext ctx, XElement elem) {
				var xName = ctx.GetXamlNsName("Name");
				if (elem.Attribute("Name") == null && elem.Attribute(xName) == null)
					elem.Add(new XAttribute(xName, FieldName));
			}
コード例 #26
0
        public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
        {
            var    record   = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
            var    bamlElem = new BamlElement(node);
            object key;

            if (record.IsType)
            {
                var value = ctx.ResolveType(record.ValueId);

                var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
                typeElem.AddAnnotation(ctx.ResolveType(0xfd4d));                 // Known type - TypeExtension
                typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), ctx.ToString(parent.Xaml, value)));
                key = typeElem;
            }
            else if (record.IsStatic)
            {
                string attrName;
                if (record.ValueId > 0x7fff)
                {
                    bool  isKey  = true;
                    short bamlId = (short)-record.ValueId;
                    if (bamlId > 232 && bamlId < 464)
                    {
                        bamlId -= 232;
                        isKey   = false;
                    }
                    else if (bamlId > 464 && bamlId < 467)
                    {
                        bamlId -= 231;
                    }
                    else if (bamlId > 467 && bamlId < 470)
                    {
                        bamlId -= 234;
                        isKey   = false;
                    }
                    var    res = ctx.Baml.KnownThings.Resources(bamlId);
                    string name;
                    if (isKey)
                    {
                        name = res.Item1 + "." + res.Item2;
                    }
                    else
                    {
                        name = res.Item1 + "." + res.Item3;
                    }
                    var xmlns = ctx.GetXmlNamespace("http://schemas.microsoft.com/winfx/2006/xaml/presentation");
                    attrName = ctx.ToString(parent.Xaml, xmlns.GetName(name));
                }
                else
                {
                    var value = ctx.ResolveProperty(record.ValueId);

                    value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
                    var xName = value.ToXName(ctx, parent.Xaml);

                    attrName = ctx.ToString(parent.Xaml, xName);
                }

                var staticElem = new XElement(ctx.GetXamlNsName("StaticExtension", parent.Xaml));
                staticElem.AddAnnotation(ctx.ResolveType(0xfda6));                 // Known type - StaticExtension
                staticElem.Add(new XElement(ctx.GetPseudoName("Ctor"), attrName));
                key = staticElem;
            }
            else
            {
                key = ctx.ResolveString(record.ValueId);
            }

            var extType = ctx.ResolveType(0xfda5);
            var resElem = new XElement(extType.ToXName(ctx));

            resElem.AddAnnotation(extType);             // Known type - StaticResourceExtension
            bamlElem.Xaml = resElem;
            parent.Xaml.Element.Add(resElem);

            var attrElem = new XElement(ctx.GetPseudoName("Ctor"));

            attrElem.Add(key);
            resElem.Add(attrElem);

            return(bamlElem);
        }