Canguro.Model.Serializer.Serializer.writeLinePointForces C# (CSharp) Method

writeLinePointForces() private method

private writeLinePointForces ( XmlWriter xml, LineElement obj ) : void
xml XmlWriter
obj LineElement
return void
        private void writeLinePointForces(XmlWriter xml, LineElement obj)
        {
            AssignedLoads loads = obj.Loads;
            if (loads != null)
            {
                Dictionary<string, LoadCase> cases = Canguro.Model.Model.Instance.LoadCases;
                foreach (LoadCase lCase in cases.Values)
                {
                    ItemList<Canguro.Model.Load.Load> list = loads[lCase];
                    if (list != null)
                    {
                        foreach (Canguro.Model.Load.Load load in list)
                        {
                            if (load != null)
                            {
                                if (load is DirectionalLineLoad)
                                {
                                    string dir = ((DirectionalLineLoad)load).Direction.ToString();
                                    string dirFrame = "GLOBAL";
                                    if (((DirectionalLineLoad)load).Direction != LineLoad.LoadDirection.Gravity)
                                    {
                                        dirFrame = dir.Substring(0, dir.Length - 1).ToUpper();
                                        dir = dir.Substring(dir.Length - 1);
                                    }
                                    if (load is ConcentratedSpanLoad)
                                    {
                                        ConcentratedSpanLoad point = (ConcentratedSpanLoad)load;
                                        xml.WriteStartElement("Frame");
                                        xml.WriteAttributeString("Frame", obj.Id.ToString());
                                        xml.WriteAttributeString("LoadCase", lCase.Name);
                                        xml.WriteAttributeString("CoordSys", dirFrame);
                                        xml.WriteAttributeString("Type", point.Type.ToString());
                                        xml.WriteAttributeString("Dir", dir);
                                        xml.WriteAttributeString("DistType", "RelDist");
                                        xml.WriteAttributeString("RelDist", point.D.ToString());
                                        xml.WriteAttributeString("AbsDist", "0");
                                        xml.WriteAttributeString("Force", point.LoadInt.ToString());
                                        xml.WriteEndElement();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }