示例#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;
        }
示例#2
0
文件: MainUI.cs 项目: grofit/Ambient
        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);
        }