public static VertexProperty Parse(XElement xElement) { string nameInShader = xElement.Attribute(strNameInShader).Value; string nameInModel = xElement.Attribute(strNameInModel).Value; string propertyType = xElement.Attribute(strPropertyType).Value; var result = new VertexProperty(nameInShader, nameInModel, propertyType); return(result); }
public static DataStructure Parse(XElement xElement) { string targetName = xElement.Attribute(strTargetName).Value; bool zeroIndexBuffer = bool.Parse(xElement.Attribute(strZeroIndexBuffer).Value); DrawMode mode = (DrawMode)Enum.Parse(typeof(DrawMode), xElement.Attribute(strDrawMode).Value); var result = new DataStructure(); result.TargetName = targetName; result.ZeroIndexBuffer = zeroIndexBuffer; result.DrawMode = mode; foreach (var item in xElement.Elements(VertexProperty.strVertexProperty)) { VertexProperty property = VertexProperty.Parse(item); result.propertyList.Add(property); } return(result); }