public void Load() { IsActive = true; FSAR bfsar = new FSAR(); bfsar.Read(new FileReader(new MemoryStream(Data))); EditorRoot = new TreeNodeFile(FileName, this); EditorRoot.Nodes.Add("Audio List"); EditorRoot.Nodes.Add("Audio Set List"); EditorRoot.Nodes.Add("Bank List"); EditorRoot.Nodes.Add("Group List"); EditorRoot.Nodes.Add("Players List"); }
public static void ReplaceNode(TreeNode replaceNode, TreeNodeFile NewNode) { if (NewNode == null) { return; } // node.Nodes.RemoveAt(index); // node.Nodes.Insert(index, NewNode); NewNode.ImageKey = replaceNode.ImageKey; NewNode.SelectedImageKey = replaceNode.SelectedImageKey; NewNode.Text = replaceNode.Text; }
/* Method :CreateTree * Author : Chandana Subasinghe * Date : 10/03/2006 * Discription : This is use to creat and build the tree * */ public bool CreateTree(TreeView treeView) { bool returnValue = false; this.InitImageList(treeView); try { // Create Desktop TreeNodeFile desktop = new TreeNodeFile(); desktop.Text = "Desktop"; desktop.Tag = "Desktop"; desktop.Nodes.Add(""); this.AddIcon(desktop); treeView.Nodes.Add(desktop); // Get driveInfo foreach (DriveInfo drv in DriveInfo.GetDrives()) { TreeNodeFile fChild = new TreeNodeFile(); if (drv.DriveType == DriveType.CDRom) { fChild.ImageIndex = 1; fChild.SelectedImageIndex = 1; fChild.Text = drv.Name; fChild.mPath = drv.Name; this.AddIcon(fChild); } else if (drv.DriveType == DriveType.Fixed) { fChild.ImageIndex = 0; fChild.SelectedImageIndex = 0; fChild.Text = drv.Name; fChild.mPath = drv.Name; this.AddIcon(fChild); } fChild.Nodes.Add(""); treeView.Nodes.Add(fChild); returnValue = true; } } catch (Exception ex) { returnValue = false; } return(returnValue); }
public static string GetTreeNodeFileDirectoryPath(TreeNodeFile parentNode) { if (parentNode.mPath != null) { return(null); } try { // To fill Desktop Char[] arr = { '\\' }; string[] nameList = parentNode.FullPath.Split(arr); string path = ""; if (nameList.GetValue(0).ToString() == "Desktop") { path = SpecialDirectories.Desktop + "\\"; for (int i = 1; i < nameList.Length; i++) { path = path + nameList[i] + "\\"; } parentNode.mPath = path; return(path); } // for other Directories else { #if false path = parentNode.FullPath; return(path); #else path = parentNode.mPath; return(path); #endif } } catch (Exception ex) { //TODO : } return(null); }
/* Method :EnumerateDirectory * Author : Chandana Subasinghe * Date : 10/03/2006 * Discription : This is use to Enumerate directories and files * */ public TreeNodeFile EnumerateDirectoryCui(TreeNodeFile parentNode) { try { DirectoryInfo rootDir = new DirectoryInfo(parentNode.mPath); parentNode.Nodes[0].Remove(); foreach (DirectoryInfo dir in rootDir.GetDirectories()) { TreeNodeFile node = new TreeNodeFile(); node.Text = dir.Name; node.mPath = dir.FullName; node.Nodes.Add(""); parentNode.Nodes.Add(node); this.AddIcon(node); node.ImageKey = this.GetKey(node); node.SelectedImageKey = this.GetKey(node); } //Fill files foreach (FileInfo file in rootDir.GetFiles()) { TreeNodeFile node = new TreeNodeFile(); node.Text = file.Name; node.mPath = file.FullName; //node.ImageIndex = 2; //node.SelectedImageIndex = 2; parentNode.Nodes.Add(node); this.AddIcon(node); node.ImageKey = this.GetKey(node); node.SelectedImageKey = this.GetKey(node); } } catch (Exception ex) { //TODO : } return(parentNode); }
public void Load() { IsActive = true; FFNT bffnt = new FFNT(); bffnt.Read(new FileReader(new MemoryStream(Data))); TGLP tglp = bffnt.finf.tglp; EditorRoot = new TreeNodeFile(FileName, this); int i = 0; foreach (byte[] texture in tglp.SheetDataList) { SheetEntry sheet = new SheetEntry(); sheet.data = texture; sheet.Text = "Sheet" + i++; EditorRoot.Nodes.Add(sheet); } }
public void Load() { IsActive = true; CanSave = true; bars = new BarsLib.BARS(new MemoryStream(Data)); EditorRoot = new TreeNodeFile(FileName, this); EditorRoot.Nodes.Add("AMTA"); EditorRoot.Nodes.Add("Audio"); for (int i = 0; i < bars.AmtaList.Count; i++) { string audioName = bars.AmtaList[i].Name; EditorRoot.Nodes[0].Nodes.Add(audioName + ".amta"); BARSAudioFile audio = bars.audioList[i]; AudioEntry node = new AudioEntry(); node.Type = audio.AudioType; node.Data = audio.data; node.SetupMusic(); if (audio.AudioType == AudioType.Bfwav) { node.Text = audioName + ".bfwav"; } else if (audio.AudioType == AudioType.Bfstp) { node.Text = audioName + ".bfstp"; } else { node.Text = audioName + ".UNKOWN"; } EditorRoot.Nodes[1].Nodes.Add(node); } }
public void AddIcon(TreeNodeFile node) { GetTreeNodeFileDirectoryPath(node); GetSysicon.GetSysIcon(node.mPath, this.mImageList); }