Example #1
0
        /// <summary>
        /// 获取一个新的<see cref="SongModel"/>实例,如果已经创建过则返回这个实例
        /// </summary>
        /// <param name="xiamiID">标志<see cref="SongModel"/>的虾米ID</param>
        /// <returns></returns>
        public static SongModel GetNew(uint xiamiID)
        {
            if (xiamiID == 0)
            {
                throw new ArgumentException("歌曲ID错误");
            }
            SongModel song = null;

            if (!(_dict?.TryGetValue(xiamiID, out song) ?? false))
            {
                song = new SongModel()
                {
                    XiamiID = xiamiID
                };
                _dict?.Add(xiamiID, song);
            }
            return(song);
        }
Example #2
0
 public ListenLogModel(SongModel song, LogDevices device, string logdate)
 {
     Song        = song;
     Device      = device;
     LogDateDiff = logdate;
 }