private void load_btn_Click(object sender, System.EventArgs e)
        {
            if ((openFileDialog1.InitialDirectory == null ||
                 !openFileDialog1.InitialDirectory.ToLower().Contains(@"data\fx")) &&
                openFileDialog1.FileName != null &&
                openFileDialog1.FileName.ToLower().Contains(@"data\fx"))
            {
                openFileDialog1.InitialDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
            }

            else if (!openFileDialog1.InitialDirectory.ToLower().Contains(@"data\fx") && fxFile != null)
            {
                openFileDialog1.InitialDirectory = Path.GetDirectoryName(fxFile);
            }

            if (eventsBhvrFilesMComboBx.Text != null)
            {
                string currentFileName = eventsBhvrFilesMComboBx.Text;

                openFileDialog1.FileName = currentFileName;
            }

            DialogResult dr = openFileDialog1.ShowDialog();

            if (dr == DialogResult.OK)
            {
                if (ownerName.Equals("Behavior"))
                {
                    BehaviorWin bWin = (BehaviorWin)this.ownerDockablePanel;
                    bWin.loadStandAloneBhvrFile(openFileDialog1.FileName);
                    this.eventsComboBx.Enabled           = true;
                    this.eventsBhvrFilesMComboBx.Enabled = true;
                    this.saveAs_btn.Enabled = true;
                }
                else
                {
                    ParticalsWin pWin = (ParticalsWin)this.ownerDockablePanel;
                    pWin.loadStandAlonePartFile(openFileDialog1.FileName);
                }

                openFileDialog1.InitialDirectory = Path.GetDirectoryName(openFileDialog1.FileName);

                eventsComboBx_SelectedIndexChanged(eventsComboBx, new System.EventArgs());

                if (eventsBhvrFilesMComboBx.Items.Count > 0)
                {
                    eventsBhvrFilesMComboBx.SelectedIndex = eventsBhvrFilesMComboBx.Items.Count - 1;
                }
            }
        }
        private void new_btn_Click(object sender, System.EventArgs e)
        {
            if (saveFileDialog1.InitialDirectory == null &&
                saveFileDialog1.FileName != null &&
                saveFileDialog1.FileName.ToLower().Contains(@"data\fx"))
            {
                saveFileDialog1.InitialDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
            }
            else if (saveFileDialog1.InitialDirectory == null &&
                     openFileDialog1.FileName != null &&
                     openFileDialog1.FileName.ToLower().Contains(@"data\fx"))
            {
                saveFileDialog1.InitialDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
            }
            if (!saveFileDialog1.InitialDirectory.ToLower().Contains(@"data\fx") && fxFile != null)
            {
                saveFileDialog1.InitialDirectory = Path.GetDirectoryName(fxFile);
            }

            if (eventsBhvrFilesMComboBx.Text != null)
            {
                string currentFileName = eventsBhvrFilesMComboBx.Text;

                saveFileDialog1.FileName = currentFileName;
            }

            DialogResult dr = saveFileDialog1.ShowDialog();

            if (dr == DialogResult.OK)
            {
                if (dr == DialogResult.OK)
                {
                    if (ownerName.Equals("Behavior"))
                    {
                        BehaviorWin bWin = (BehaviorWin)this.ownerDockablePanel;
                        bWin.setBhvrPanels(new Behavior("null.bhvr"));
                        common.COH_IO.writeDistFile(bWin.getData(), saveFileDialog1.FileName);
                        bWin.loadStandAloneBhvrFile(saveFileDialog1.FileName);
                    }
                    else
                    {
                        ParticalsWin pWin = (ParticalsWin)this.ownerDockablePanel;
                        pWin.setPartPanels(new Partical("null.part", false));
                        common.COH_IO.writeDistFile(pWin.getData(), saveFileDialog1.FileName);
                        pWin.loadStandAlonePartFile(saveFileDialog1.FileName);
                    }
                    enableElements(true);
                }
            }
        }