Example #1
0
        protected override void DeserializeBrickTubeModel(BrickTubeModel brickTubeModel, XElement element)
        {
            DeserializePartCullingModel(brickTubeModel, element);

            //LEGACY
            if (element.HasElement(StudReference.NODE_NAME, out XElement tubeStudElem))
            {
                var studRef = StudReference.FromXml(tubeStudElem);
                if (!string.IsNullOrEmpty(brickTubeModel.LegacyConnectionID))
                {
                    studRef.ConnectionID = brickTubeModel.LegacyConnectionID;
                }
                brickTubeModel.ReferencedStuds.Add(studRef);
                //TubeStud = StudReference.FromXml(tubeStudElem);
                //if (!string.IsNullOrEmpty(LegacyConnectionID))
                //    TubeStud.ConnectionID = LegacyConnectionID;
            }

            brickTubeModel.TubeStud = brickTubeModel.ReferencedStuds.FirstOrDefault();

            brickTubeModel.AdjacentStuds.Clear();
            if (element.HasElement(nameof(BrickTubeModel.AdjacentStuds), out XElement adjStudsElem))
            {
                foreach (var adjStudElem in adjStudsElem.Elements(StudReference.NODE_NAME))
                {
                    var studRef = StudReference.FromXml(adjStudElem);
                    if (!string.IsNullOrEmpty(brickTubeModel.LegacyConnectionID))
                    {
                        studRef.ConnectionID = brickTubeModel.LegacyConnectionID;
                    }
                    brickTubeModel.AdjacentStuds.Add(studRef);
                }
            }
        }
Example #2
0
        protected override void DeserializePartCullingModel(PartCullingModel partCullingModel, XElement element)
        {
            DeserializeBaseElement(partCullingModel, element);

            partCullingModel.LegacyConnectionID = element.ReadAttribute("ConnectionID", string.Empty);

            partCullingModel.ReferencedStuds.Clear();

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