Beispiel #1
0
        protected internal override void LoadFromXml(XElement element)
        {
            base.LoadFromXml(element);

            if (element.HasElement(nameof(ReplacementMeshes), out XElement geomElem))
            {
                foreach (var elem in geomElem.Elements(ModelMeshReference.NODE_NAME))
                {
                    var mesh = new ModelMeshReference();
                    mesh.LoadFromXml(elem);
                    ReplacementMeshes.Add(mesh);
                }
            }

            //LEGACY
            if (element.HasElement("Studs", out XElement studsElem))
            {
                foreach (var studElem in studsElem.Elements(StudReference.NODE_NAME))
                {
                    var studRef = StudReference.FromXml(studElem);
                    if (!string.IsNullOrEmpty(LegacyConnectionID))
                    {
                        studRef.ConnectionID = LegacyConnectionID;
                    }
                    ReferencedStuds.Add(studRef);
                }
            }
        }
Beispiel #2
0
        protected internal override void LoadFromXml(XElement element)
        {
            base.LoadFromXml(element);
            LegacyConnectionID = element.ReadAttribute("ConnectionID", string.Empty);

            ReferencedStuds.Clear();

            if (element.HasElement(nameof(ReferencedStuds), out XElement studsElem))
            {
                foreach (var studElem in studsElem.Elements(StudReference.NODE_NAME))
                {
                    var studRef = StudReference.FromXml(studElem);
                    if (!string.IsNullOrEmpty(LegacyConnectionID))
                    {
                        studRef.ConnectionID = LegacyConnectionID;
                    }
                    ReferencedStuds.Add(studRef);
                }
            }
        }