public void UpdateAssets(string assetFile, UpdatePropertiesDelegate updateProps, UpdateOutputDelegate updateOutput, OpenEffectFile openEffect, MaterialsView materialsHandle) { if (!File.Exists(assetFile)) { return; } m_AssetPath = assetFile; m_ProjectLocation = Path.GetDirectoryName(assetFile); m_NodeDelegate = updateProps; m_OuputDeleagate = updateOutput; m_OpenEffect = openEffect; m_MaterialsHandle = materialsHandle; m_MaterialsHandle.UpdateDelegate = m_NodeDelegate; m_XmlDoc.Load(assetFile); XmlElement rootXml = m_XmlDoc.DocumentElement; treeViewAssets.BeginUpdate(); foreach (XmlNode node in rootXml.ChildNodes) { TreeNode treeNode = treeViewAssets.Nodes[node.Name]; if (treeNode != null) { treeNode.Tag = node; treeNode.Nodes.Clear(); foreach (XmlNode child in node.ChildNodes) { if (node.Name == "Effects") { AddEffect(treeNode, child); } else if (node.Name == "Materials") { AddMaterial(treeNode, child); } else { XmlNode nameNode = child.Attributes["name"]; if (nameNode != null) { treeNode.Nodes.Add(new TreeNode(nameNode.Value) { Tag = child }); } } } } } treeViewAssets.EndUpdate(); }
private void CreateStandardViews() { m_MaterialView = new MaterialsView(); m_AssetsView = new AssetsView(); m_ProjectView = new ProjectView(); m_PropertiesView = new PropertiesView(); m_outputView = new OutputView(); m_taskView = new TaskListView(); m_EditorView = new EditorView(); m_RenderView = new RenderView(); }