private void ValidateNodeName(ValidateObjectProperty <ViewModelNode, string> obj) { if (!String.IsNullOrWhiteSpace(obj.Property)) { if (!Nodes.Any(x => x.Name == obj.Property)) { obj.Obj.Name = obj.Property; } } }
private void ValidateConnectName(ValidateObjectProperty <ViewModelConnector, string> obj) { if (!String.IsNullOrWhiteSpace(obj.Property)) { if (!Connects.Any(x => x.FromConnector.Name == obj.Property)) { obj.Obj.Name = obj.Property; } } }
internal void AddUser(UserViewModel userViewModel) { if (_users.Any(x => x.User.Equals(userViewModel))) { return; } var userVm = new RoomUserViewModel(userViewModel); userVm.IsOwner = _owners.Any(x => x.Equals(userVm.User.Name)); _users.Add(userVm); // TODO: Implement notification to the room of the joined user }
public ScanAreaModel AddArea(string key) { if (Areas.Any(x => x.Key == key)) { return(null); } var model = new ScanAreaModel { Width = 64, Height = 64, Key = key }; areas.Add(model); return(model); }
public bool Any() { return(_selectedItems.Any()); }