Ejemplo n.º 1
0
        public static IPlayerControl GetSoundControl(ISoundState soundState)
        {
            IPlayerControl playerControl;

            if(soundState is AmbientState)
            { playerControl = new AmbientPlayerControl(); }
            else if(soundState is IntervalSoundState)
            { playerControl = new IntervalSoundPlayerControl(); }
            else
            { throw new Exception(string.Format("Unable to bind state [{0}] to control", soundState.SoundTypeIdentifier)); }

            playerControl.PopulateFromState(soundState);
            return playerControl;
        }
Ejemplo n.º 2
0
        void ambientPlayerToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            var columnRow = GetColumnRowFromControl(contextSourceControl);
            tablePanel.Controls.Remove(contextSourceControl);

            var ambientPlayer = new AmbientPlayerControl();
            ambientPlayer.ColumnPosition = columnRow.X;
            ambientPlayer.RowPosition = columnRow.Y;
            ambientPlayer.ContextMenuStrip = playerContextMenuStrip;
            tablePanel.Controls.Add(ambientPlayer, columnRow.X, columnRow.Y);
        }