Exemplo n.º 1
0
        /// <summary>
        /// Called when the selected index has changed.  If it's anything but 0, create the appropriate
        /// action
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mActionTypesComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            Otter.UI.Actions.Action newAction = null;
            switch (mActionTypesComboBox.SelectedIndex)
            {
            // Do nothing
            case 0:
            {
                return;
            }

            // Send Message
            case 1:
            {
                newAction = new Otter.UI.Actions.MessageAction();
                break;
            }

            // Play Sound
            case 2:
            {
                newAction = new Otter.UI.Actions.SoundAction();
                break;
            }
            }

            newAction.Scene = mScene;
            mActions.Add(newAction);

            Actions = mActions;
            mActionTypesComboBox.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Removes the selected item
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mRemoveButton_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in mItemsListView.SelectedItems)
            {
                Otter.UI.Actions.Action action = item.Tag as Otter.UI.Actions.Action;
                mActions.Remove(action);
            }

            Actions = new List <UI.Actions.Action>(mActions);
        }