Ejemplo n.º 1
0
        public static bool isElementSp3dTask_Old(this Element element, out Sp3dTask_Old task)
        {
            P3DHangerPipeSupport  pipe      = null;
            P3DHangerStdComponent component = null;
            P3DEquipment          equipment = null;

            task = null;

            //string xmlSummary = string.Empty;
            var xmlSumBilder = new System.Text.StringBuilder();

            if (element == null)
            {
                return(false);
            }

            IEnumerable <string> summaryXmlData = ElementHelper.getSp3dXmlData(element);

            foreach (string xmlData in summaryXmlData)
            {
                if (xmlData.StartsWith("<P3DEquipment"))
                {
                    equipment = XmlSerializerEx.FromXml <P3DEquipment>(xmlData);
                }
                else if (xmlData.StartsWith("<P3DHangerPipeSupport"))
                {
                    pipe = XmlSerializerEx.FromXml <P3DHangerPipeSupport>(xmlData);
                }
                else if (xmlData.StartsWith("<P3DHangerStdComponent"))
                {
                    component = XmlSerializerEx.FromXml <P3DHangerStdComponent>(xmlData);
                }
            }

            if (equipment != null)
            {
                task = new Sp3dTask_Old(equipment, summaryXmlData);
            }
            else if (pipe != null && component != null)
            {
                task = new Sp3dTask_Old(pipe, component, summaryXmlData);
            }

            return(task != null);
        }
Ejemplo n.º 2
0
 public Sp3dTask_Old(P3DHangerPipeSupport pipe, P3DHangerStdComponent component, IEnumerable <string> xmlData)
 {
     this.pipe      = pipe;
     this.component = component;
     readXmlDoc(xmlData);
 }