private void NewRoomOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { var room = (BuildingRoom)sender; if (m_Rooms.Count(r => r.Name == room.Name) > 1) { room.Name = room.Name + " (duplicate)"; } }
public void addPublicRoom(Room room) { BindableCollection <SelectableRoom> roomAlreadyExists = new BindableCollection <SelectableRoom>(this.selectablePublicRooms.Where(x => x.id == room.id)); if (roomAlreadyExists.Count() == 0) { selectablePublicRooms.Add(new SelectableRoom(room)); } }
public Dictionary <string, string> theMap() { IEnumerable <SelectableRoom> enumSR = _selectableJoinedRooms.Where(x => x.room.id == "General"); BindableCollection <SelectableRoom> sRs = new BindableCollection <SelectableRoom>(enumSR); if (sRs.Count() != 1) { Console.WriteLine("il exite un doublon de general dans les rooms jointes"); } return(sRs[0].room.avatars); }
//public async Task LoadItemsAsync() //{ // Departments = new BindableCollection<DepartmentModel>(await _companyAccess.Departments(CurrentCompany)); // //Departments.CollectionChanged += HandleItemChange; // NotifyOfPropertyChange(() => Departments); //} public async Task LoadWorkPeriods() { Debug.WriteLine("Loading departments..."); //WorkPeriods = new BindableCollection<WorkPeriodModel>(await _companyAccess.FetchWorkPeriodsAsync(SelectedDepartment)); var workPeriods = await _companyAccess.FetchWorkPeriodsAsync(SelectedDepartment); var users = workPeriods.SelectMany(wp => wp.AssignedUsers); WorkPeriods = new BindableCollection <UserModel>(users); Debug.WriteLine($"Loaded {WorkPeriods.Count()} departments."); NotifyOfPropertyChange(() => Departments); NotifyOfPropertyChange(() => WorkPeriods); }
public profileViewModel(IUserData userdata, IEventAggregator events, ISocketHandler socketHandler) { _userData = userdata; _events = events; _events.Subscribe(this); _socketHandler = socketHandler; this.statsClient = JsonConvert.DeserializeObject <StatsClient>(this._socketHandler.TestGETWebRequest("/profile/stats/" + this._userData.userName).ToString()); _avatars = new BindableCollection <Avatar>(); fillAvatars(); nbAvatars = _avatars.Count(); _selectedAvatarIndex = 0; _initialPP = JsonConvert.DeserializeObject <PrivateProfile>(socketHandler.TestGETWebRequest("/profile/private/" + userdata.userName).ToString()); _newlPP = new PrivateProfile(_initialPP.firstname, _initialPP.firstname, _initialPP.lastname, _initialPP.password, _initialPP.avatar); }
public void addModifiedProfile(PublicProfile profile) { if (profile.username == _userName) { _avatarName = profile.avatar; } IEnumerable <SelectableRoom> enumSR = _selectableJoinedRooms.Where(x => x.id == "General"); BindableCollection <SelectableRoom> sRs = new BindableCollection <SelectableRoom>(enumSR); if (sRs.Count() != 1) { Console.WriteLine("il exite un doublon de general dans les rooms jointes"); } _selectableJoinedRooms[_selectableJoinedRooms.IndexOf(sRs[0])].room.avatars[profile.username] = profile.avatar; _selectableJoinedRooms.Refresh(); }
public void addJoinedRoom(Room room, Boolean isPrivate) { BindableCollection <SelectableRoom> roomAlreadyExists = new BindableCollection <SelectableRoom>(this.selectableJoinedRooms.Where(x => x.id == room.id)); if (roomAlreadyExists.Count() == 0) { SelectableRoom sR = new SelectableRoom(room); foreach (Message m in sR.room.messages) { string MessageAvatarName = ""; try { MessageAvatarName = theMap()[m.senderName]; } catch { } if (m.senderName == "Admin") { MessageAvatarName = "ADMIN"; } m.avatarSource = getAvatarSource(MessageAvatarName); } sR.isPrivate = isPrivate; selectableJoinedRooms.Add(sR); } }
int GetActiveTaskCount() { return(_archivedTasks.Count(x => x.Status == PhotoUploadStatus.Uploading || x.Status == PhotoUploadStatus.Completing)); }