Example #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);
                }
            }
        }
Example #2
0
        protected Custom2DFieldReference ConvertToRef(StudReference studReference)
        {
            var fieldRef = new Custom2DFieldReference(studReference.ConnectionIndex);

            fieldRef.FieldIndices.Add(new Custom2DFieldIndex()
            {
                Index  = studReference.FieldIndex,
                Value2 = studReference.Value1,
                Value4 = studReference.Value2
            });
            return(fieldRef);
        }
Example #3
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);
                }
            }
        }