| | |
| | | public class MusicMain : FrameLayout |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// MusicMain对象构造函数 |
| | | /// </summary> |
| | | public MusicMain() |
| | | { |
| | | Tag = "MusicMain"; |
| | | //进来音乐列表界面先移除之前线程; |
| | | A31MusicModel.RemoveListThread(); |
| | | } |
| | | /// <summary> |
| | | /// 重写RemoveFromParent方法 |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | clearA31Threads(); |
| | | A31MusicModel.ReadMusicStates();//进来没有音乐被收藏过,退出有音乐被收藏过 |
| | | } |
| | | /// <summary> |
| | | /// 创建线程列表 |
| | | /// </summary> |
| | | static List<System.Threading.Thread> threadLists = new List<System.Threading.Thread>(); |
| | | /// <summary> |
| | | /// 移除线程 |
| | |
| | | threadLists.Remove(thread); |
| | | if (thread.IsAlive) |
| | | { |
| | | ///强制线程抛异常 |
| | | thread.Abort(); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 显示加载界面 |
| | | /// </summary> |
| | | public static Loading loading = new Loading(); |
| | | /// <summary> |
| | | /// 定义全局对象 |
| | | /// </summary> |
| | | VerticalRefreshLayout verticalRefresh; |
| | | |
| | | public void Show() |
| | | { |
| | | |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新播放器列表 |
| | | /// </summary> |
| | | /// <param name="Yes">是否显示刷新图标</param> |
| | | void SeachMusic(bool Yes = false) |
| | | { |
| | | for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++) |
| | |
| | | { |
| | | if (a31player.ServerClientType == 0) |
| | | { |
| | | new View.DialogView { }.PlayMergence(); |
| | | new View.DialogView { }.PlayMergence(a31player); |
| | | } |
| | | else if (a31player.ServerClientType == 1) |
| | | { |
| | |
| | | musicThread.Start(); |
| | | threadLists.Add(musicThread); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取主从关系 |
| | | /// </summary> |