예제 #1
0
        private void Execute_Reset(object obj)
        {
            var p = (SfDataGrid)obj;

            p.SearchHelper.ClearSearch();
            var res = roomRepository.Get(null, null, "room_status,room_type");

            RoomList.Clear();
            res.Distinct().ToList().ForEach(i => _roomList.Add(i));
        }
예제 #2
0
 /// <summary>
 /// Stop the Room system.
 /// </summary>
 public override void Stop()
 {
     SystemHost.UpdateSystemHost(this, "Stopping...");
     foreach (IRoom r in RoomList.Values)
     {
         if (r.GetType().Equals(typeof(UserOwnedRoom)))
         {
             Room.manager.Save(((UserOwnedRoom)r).Data);
         }
     }
     RoomList.Clear();
     SystemHost.UpdateSystemHost(this, "Stopped");
 }
예제 #3
0
        private void Execute_DelRoom(object obj)
        {
            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Confirmation", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                var p = (room)obj;
                roomRepository.Delete(p);
                var res = roomRepository.Get(null, null, "room_status,room_type");
                RoomList.Clear();
                res.Distinct().ToList().ForEach(i => _roomList.Add(i));
                System.Windows.Forms.MessageBox.Show("Successfully updated", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #4
0
        /// <summary>
        /// 第一次加载所有
        /// </summary>
        private void FirstLoad()
        {
            RoomList.Clear();

            foreach (var item in Resources.GetRes().RoomsModel.OrderByDescending(x => x.Order).ThenBy(x => x.RoomNo.Length).ThenBy(x => x.RoomNo))
            {
                RoomList.Add(new RoomStateModel()
                {
                    RoomId = item.RoomId, RoomNo = item.RoomNo, UseState = (null != item.PayOrder), OrderSession = item.OrderSession, PayOrder = item.PayOrder, OpenRoom = OpenRoom
                });
            }


            RefreshAll(false);
        }
예제 #5
0
 private void closeConnection()
 {
     try
     {
         UsersInRoomList.Clear();
         RoomList.Clear();
         if (_serverConnection != null)
         {
             _serverConnection.ConnectionClosed -= new EventHandler <EventArgs>(_serverConnection_ConnectionClosed);
             _serverConnection.DataReceived     -= new EventHandler <EventArgs>(_serverConnection_DataReceived);
             _serverConnection.Dispose();
             _serverConnection = null;
         }
         ChatConnectionStatus = ConnectionStatus.NotConnected;
         checkRetry();
     }
     catch
     {
         _serverConnection    = null;
         ChatConnectionStatus = ConnectionStatus.NotConnected;
     }
 }