Beispiel #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _localRoom    = LocalRoom.GetLocalRoom();
            _roomInfoList = _localRoom.GetInfoList();
            refreshData();

            Downloader tempDown;

            _downloaderList = new List <Downloader>();
            foreach (RoomInfo info in _roomInfoList)
            {
                tempDown          = new Downloader(this);
                tempDown.RoomInfo = info;
                if (info.RunSetting == true)
                {
                    _downloaderList.Add(tempDown);
                }
            }

            _config = Config.GetConfig();
            var saveLoaction = _config.SaveLoaction;

            savepathBox.Text = saveLoaction == null ? "" : saveLoaction;

            AppendLogln("INFO", "启动成功。");
        }
Beispiel #2
0
 //双重锁定,学习单例模式
 public static LocalRoom GetLocalRoom()
 {
     if (localRoom == null)
     {
         lock (locker)
         {
             if (localRoom == null)
             {
                 localRoom = new LocalRoom();
             }
         }
     }
     return(localRoom);
 }