Beispiel #1
0
        private void SetNameDropDownList()
        {
            panel1.Controls.Clear();
            cboName.Items.Clear();

            // if cboType is "Assets Folder"...
            if (cboType.SelectedIndex == 0)
            {
                foreach (var file in Directory.GetFiles(Program.State.AssetsDirectory))
                {
                    var fileName = Path.GetFileName(file);

                    if ((DesignerState.GetAssetType(fileName) == EngineResourceFileTypes.Audio) ||
                        (DesignerState.GetAssetType(fileName) == EngineResourceFileTypes.Video))
                    {
                        cboName.Items.Add(fileName);
                    }
                }
            }
            else
            {
                foreach (var resFile in Program.State.EngineState.ResourceFiles)
                {
                    foreach (var item in resFile.GetAllNames(EngineResourceFileTypes.Audio))
                    {
                        cboName.Items.Add(string.Format("{0} -> Audio -> {1}", Path.GetFileName(resFile.FilePath), item));
                    }

                    foreach (var item in resFile.GetAllNames(EngineResourceFileTypes.Video))
                    {
                        cboName.Items.Add(string.Format("{0} -> Video -> {1}", Path.GetFileName(resFile.FilePath), item));
                    }
                }
            }
        }
Beispiel #2
0
        private void BindValueBag()
        {
            dgValueBag.AutoGenerateColumns = true;
            var dt = DesignerState.GetDataTableFromValueBag(_sheet.ValueBag);

            dgValueBag.DataSource = dt;

            dt.RowChanged += dt_RowChanged;
        }
Beispiel #3
0
        private void cmdOpen_Click(object sender, EventArgs e)
        {
            var dlg = new OpenFileDialog();

            dlg.Filter = DesignerState.GetDialogFilter(null);

            var result = dlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                bool isBinary = DesignerState.IsBinaryExtension(dlg.FileName);
                Program.State.LoadEngineState(dlg.FileName, isBinary);
            }
        }
Beispiel #4
0
 private void dgValueBag_Leave(object sender, EventArgs e)
 {
     _sheet.ValueBag = DesignerState.GetValueBagFromDataTable((DataTable)dgValueBag.DataSource);
 }
Beispiel #5
0
 private void dt_RowChanged(object sender, DataRowChangeEventArgs e)
 {
     _sheet.ValueBag       = DesignerState.GetValueBagFromDataTable((DataTable)dgValueBag.DataSource);
     Program.State.IsDirty = true;
 }
Beispiel #6
0
 private void dgValueBag_Leave(object sender, EventArgs e)
 {
     Program.State.EngineState.ValueBag = DesignerState.GetValueBagFromDataTable((DataTable)dgValueBag.DataSource);
 }