internal static DocumentXml ConvertToXmlDoc(ODMLDocument document) { var xml = new DocumentXml(); xml.HideNonsenceLabels = document.HideNonsenceLabels; xml.EntityTypes = new EntityTypeElementXml[document.EntityTypes.Count]; for (int i = 0, c = document.EntityTypes.Count; i < c; i++) { var item = document.EntityTypes[i]; xml.EntityTypes[i] = EntityTypeElementXml.ConvertToNode(item); } xml.EnumTypes = new EnumElementXml[document.EnumTypes.Count]; for (int i = 0, c = document.EnumTypes.Count; i < c; i++) { var item = document.EnumTypes[i]; xml.EnumTypes[i] = EnumElementXml.ConvertToNode(item); } xml.Connections = new ConnectionElementXml[document.Connections.Count]; for (int i = 0, c = document.Connections.Count; i < c; i++) { var item = document.Connections[i]; xml.Connections[i] = ConnectionElementXml.ConvertToNode(item); } return(xml); }
internal static ConnectionElementXml ConvertToNode(ConnectionElement model) { var xml = new ConnectionElementXml(); xml.From = model.From; xml.To = model.To; xml.Label = model.Label; xml.ConnectionType = model.ConnectionType; xml.Hidden = model.Hidden; xml.LabelVisible = model.LabelVisible; if (model.FromPointPos.HasValue) { xml.FromPointX = model.FromPointPos.Value.X; xml.FromPointY = model.FromPointPos.Value.Y; } if (model.ToPointPos.HasValue) { xml.ToPointX = model.ToPointPos.Value.X; xml.ToPointY = model.ToPointPos.Value.Y; } return(xml); }
internal static ConnectionElementXml ConvertToNode(ConnectionElement model) { var xml = new ConnectionElementXml(); xml.From = model.From; xml.To = model.To; xml.Label = model.Label; xml.ConnectionType = model.ConnectionType; xml.Hidden = model.Hidden; xml.LabelVisible = model.LabelVisible; if (model.FromPointPos.HasValue) { xml.FromPointX = model.FromPointPos.Value.X; xml.FromPointY = model.FromPointPos.Value.Y; } if (model.ToPointPos.HasValue) { xml.ToPointX = model.ToPointPos.Value.X; xml.ToPointY = model.ToPointPos.Value.Y; } return xml; }