예제 #1
0
        public ICommand CreateCommand()
        {
            List <AssetDesc> assets = app.Assets.Select("Sound");
            ICommand         ret    = null;
            // bool add = false;

            // add = true;
            string title = "Add Sound";

            if (String.Equals(filename, ""))
            {
                using (comboBoxPrompt dlg = new comboBoxPrompt(assets, this.filename, title, anchor, "&Add"))
                {
                    DialogResult result = dlg.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        this.filename = (app.Assets.assetFromName(dlg.ComboBoxSelectedItemAsString)).AssetName;
                    }
                    if (result == DialogResult.Cancel)
                    {
                        return(null);
                    }
                }
            }
            ret = new AddSoundCommand(app, parent, filename);
            return(ret);
        }
        public ICommand CreateCommand()
        {
            List<AssetDesc> assets = app.Assets.Select("Sound");
            ICommand ret = null;
            // bool add = false;

            // add = true;
            string title = "Add Sound";
            if (String.Equals(filename, ""))
            {
                using (comboBoxPrompt dlg = new comboBoxPrompt(assets, this.filename, title, anchor, "&Add"))
                {

                    DialogResult result = dlg.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        this.filename = (app.Assets.assetFromName(dlg.ComboBoxSelectedItemAsString)).AssetName;
                    }
                    if (result == DialogResult.Cancel)
                    {
                        return null;
                    }
                }
            }
            ret = new AddSoundCommand(app, parent, filename);
            return ret;
        }