Exemple #1
0
        /// <summary>
        /// 获取当前状态,用于向线程池加入任务时传递参数
        /// </summary>
        /// <returns></returns>
        private PlayerState GetPlayerState()
        {
            PlayerState ps = null;

            if (CheckAccess())
            {
                ps = new PlayerState(Settings.User == null ? null : (User)Settings.User.Clone(),
                                     CurrentChannel == null ? null : (Channel)CurrentChannel.Clone(),
                                     CurrentSong == null ? null : (Song)CurrentSong.Clone());
            }
            else
            {
                Dispatcher.Invoke(new Action(() => { ps = GetPlayerState(); }));
            }
            return(ps);
        }