public static MaterialDefinition LoadFromXPathNavigator(XPathNavigator navigator) { if (navigator == null) { return(null); } MaterialDefinition materialDefinition = new MaterialDefinition(); //name materialDefinition.Name = navigator.GetAttribute("Name", String.Empty); materialDefinition.NameHash = Jenkins.OneAtATime(materialDefinition.Name); //type materialDefinition.Type = navigator.GetAttribute("Type", String.Empty); materialDefinition.TypeHash = Jenkins.OneAtATime(materialDefinition.Type); //draw styles XPathNodeIterator entries = navigator.Select("./Array[@Name='DrawStyles']/Object[@Class='DrawStyle']"); while (entries.MoveNext()) { DrawStyle drawStyle = DrawStyle.LoadFromXPathNavigator(entries.Current); if (drawStyle != null) { materialDefinition.DrawStyles.Add(drawStyle); } } return(materialDefinition); }
public static DrawStyle LoadFromXPathNavigator(XPathNavigator navigator) { if (navigator == null) { return null; } DrawStyle drawStyle = new DrawStyle(); //name drawStyle.Name = navigator.GetAttribute("Name", String.Empty); drawStyle.NameHash = Jenkins.OneAtATime(drawStyle.Name); //effect drawStyle.Effect = navigator.GetAttribute("Effect", String.Empty); //input layout String vertexLayout = navigator.GetAttribute("InputLayout", String.Empty); drawStyle.VertexLayoutNameHash = Jenkins.OneAtATime(vertexLayout); return drawStyle; }
public static DrawStyle LoadFromXPathNavigator(XPathNavigator navigator) { if (navigator == null) { return(null); } DrawStyle drawStyle = new DrawStyle(); //name drawStyle.Name = navigator.GetAttribute("Name", String.Empty); drawStyle.NameHash = Cryptography.JenkinsOneAtATime(drawStyle.Name); //effect drawStyle.Effect = navigator.GetAttribute("Effect", String.Empty); //input layout string vertexLayout = navigator.GetAttribute("InputLayout", String.Empty); drawStyle.VertexLayoutNameHash = Cryptography.JenkinsOneAtATime(vertexLayout); return(drawStyle); }