/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (projectTreeView.SelectedNode == null)
            {
                return;
            }
            switch (Path.GetExtension(projectTreeView.SelectedNode.FullPath.ToLower()))
            {
            case ".wav":
            case ".ogg":
            {
                MusicPlayerWindow window = new MusicPlayerWindow(projectTreeView.SelectedNode.FullPath);
                window.Show(this.Parent);
                break;
            }

            case ".fso":
            case ".fs":
            case ".fsl":
            {
                ScriptEditorWindow window = new ScriptEditorWindow(projectTreeView.SelectedNode.FullPath);
                window.FormClosing += new FormClosingEventHandler(ScriptEditorClosed);
                window.Show(this);
            }
            break;

            //case ".pk":
            //case ".dll":
            //     break;

            case ".fef":
            {
                EmitterEditorWindow window = new EmitterEditorWindow();
                if (IOMethods.FileSize(projectTreeView.SelectedNode.FullPath.ToLower()) > 3)
                {
                    Stream       stream = StreamFactory.RequestStream(projectTreeView.SelectedNode.FullPath, StreamMode.Open);
                    BinaryReader reader = new BinaryReader(stream);
                    reader.ReadBytes(3);

                    window.Emitter = new EmitterNode();
                    window.Emitter.Load(reader);

                    reader.Close();
                    stream.Close();
                }
                //if (window.ShowDialog() == DialogResult.OK)
                //{
                //   Stream stream = StreamFactory.RequestStream(projectTreeView.SelectedNode.FullPath, StreamMode.Truncate);
                //    BinaryWriter writer = new BinaryWriter(stream);

                //    writer.Write(new byte[] { (byte)'F', (byte)'E', (byte)'F' });
                //    window.Emitter.Save(writer);

                //    writer.Close();
                //    stream.Close();
                //}
                break;
            }

            case ".fmp":
                Editor.GlobalInstance.Window.OpenMap(projectTreeView.SelectedNode.FullPath);
                break;

            case ".xml":
            {
                if (projectTreeView.SelectedNode.FullPath.ToLower().StartsWith(Fusion.Editor.Editor.GlobalInstance.TilesetPath.ToLower()))
                {
                    if (IOMethods.FileSize(projectTreeView.SelectedNode.FullPath.ToLower()) == 0)
                    {
                        MessageBox.Show("This tileset configuration file is empty, unable to open tileset viewer.", "Empty", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    TilesetWindow window = new TilesetWindow(projectTreeView.SelectedNode.FullPath);
                    window.SelectionChanged += new EventHandler(tilesetWindow_TilesetSelectionChanged);
                    window.ColorChanged     += new EventHandler(tilesetWindow_TilesetColorChanged);
                    window.Show(this.Parent);
                }
                else
                {
                    ScriptEditorWindow window = new ScriptEditorWindow(projectTreeView.SelectedNode.FullPath);
                    window.IsPlainFile = true;
                    window.Show(this);
                }
                break;
            }

            case ".png":
            case ".bmp":
            case ".tga":
            {
                ImageWindow window = new ImageWindow(projectTreeView.SelectedNode.FullPath);
                window.Show(this.Parent);
                break;
            }

            default:
                Process process = new Process();
                process.StartInfo.FileName    = @"explorer";
                process.StartInfo.Arguments   = projectTreeView.SelectedNode.FullPath;
                process.StartInfo.Verb        = "Open";
                process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
                process.Start();
                break;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (projectTreeView.SelectedNode == null) return;
            switch (Path.GetExtension(projectTreeView.SelectedNode.FullPath.ToLower()))
            {
                case ".wav":
                case ".ogg":
                    {
                        MusicPlayerWindow window = new MusicPlayerWindow(projectTreeView.SelectedNode.FullPath);
                        window.Show(this.Parent);
                        break;
                    }

                case ".fso":
                case ".fs":
                case ".fsl":
                    {
                        ScriptEditorWindow window = new ScriptEditorWindow(projectTreeView.SelectedNode.FullPath);
                        window.FormClosing += new FormClosingEventHandler(ScriptEditorClosed);
                        window.Show(this);
                    }
                    break;

                //case ".pk":
                //case ".dll":
                //     break;

                case ".fef":
                     {
                         EmitterEditorWindow window = new EmitterEditorWindow();
                         if (IOMethods.FileSize(projectTreeView.SelectedNode.FullPath.ToLower()) > 3)
                         {
                             Stream stream = StreamFactory.RequestStream(projectTreeView.SelectedNode.FullPath, StreamMode.Open);
                             BinaryReader reader = new BinaryReader(stream);
                             reader.ReadBytes(3);

                             window.Emitter = new EmitterNode();
                             window.Emitter.Load(reader);

                             reader.Close();
                             stream.Close();
                         }
                         //if (window.ShowDialog() == DialogResult.OK)
                         //{
                         //   Stream stream = StreamFactory.RequestStream(projectTreeView.SelectedNode.FullPath, StreamMode.Truncate);
                         //    BinaryWriter writer = new BinaryWriter(stream);

                         //    writer.Write(new byte[] { (byte)'F', (byte)'E', (byte)'F' });
                         //    window.Emitter.Save(writer);

                         //    writer.Close();
                         //    stream.Close();
                         //}
                         break;
                     }

                case ".fmp":
                     Editor.GlobalInstance.Window.OpenMap(projectTreeView.SelectedNode.FullPath);
                     break;

                case ".xml":
                     {
                         if (projectTreeView.SelectedNode.FullPath.ToLower().StartsWith(Fusion.Editor.Editor.GlobalInstance.TilesetPath.ToLower()))
                         {
                             if (IOMethods.FileSize(projectTreeView.SelectedNode.FullPath.ToLower()) == 0)
                             {
                                 MessageBox.Show("This tileset configuration file is empty, unable to open tileset viewer.", "Empty", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                 return;
                             }
                             TilesetWindow window = new TilesetWindow(projectTreeView.SelectedNode.FullPath);
                             window.SelectionChanged += new EventHandler(tilesetWindow_TilesetSelectionChanged);
                             window.ColorChanged += new EventHandler(tilesetWindow_TilesetColorChanged);
                             window.Show(this.Parent);
                         }
                         else
                         {
                             ScriptEditorWindow window = new ScriptEditorWindow(projectTreeView.SelectedNode.FullPath);
                             window.IsPlainFile = true;
                             window.Show(this);
                         }
                         break;
                     }

                case ".png":
                case ".bmp":
                case ".tga":
                     {
                         ImageWindow window = new ImageWindow(projectTreeView.SelectedNode.FullPath);
                         window.Show(this.Parent);
                         break;
                     }

                default:
                     Process process = new Process();
                     process.StartInfo.FileName = @"explorer";
                     process.StartInfo.Arguments = projectTreeView.SelectedNode.FullPath;
                     process.StartInfo.Verb = "Open";
                     process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
                     process.Start();
                     break;
            }
        }