public IActionResult Edit(int id, Blocked Blocked) { db.Entry(Blocked).State = Microsoft.EntityFrameworkCore.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public void Block() { IsBlocked = true; this.fade.color = this.fade.color.With(a: 0.75f); Blocked?.Invoke(this); }
/// <summary> /// Raises event 'Blocked' /// </summary> protected virtual void OnBlocked() { if (Blocked != null) { Blocked.Invoke(this, System.EventArgs.Empty); } }
internal MessageSender(MsgType type, string message, Metro.Api.Station srource, Blocked blocked) { _type = type; _msg = message == null ? "" : message; _srcMsg = srource; _blocked = blocked; }
public IActionResult Add(Blocked Blocked) { db.Blocked.Add(Blocked); db.SaveChanges(); return(RedirectToAction("Index")); }
private void IncreaseTime() { GlobalTime++; foreach (Process p in Ready) { p.tEsp++; } bool DeInterrupt = false; foreach (Process p in Blocked) { p.tEsp++; p.tBlR = 8 - p.tBlo++; if (p.tBlo >= 8) { DeInterrupt = true; p.tBlo = 0; } } if (DeInterrupt) { var topBlo = Blocked.Peek(); mW.tblBlocked.Rows.RemoveAt(0); mW.tblReady.Rows.Add(topBlo.Id, topBlo.TME, topBlo.tRst); Deinterrupt(); } }
public void Publish_Where_Publication_Configurations_Exist_Which_Results_In_Blocked_Result() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); _busConfigurationBuilder .RegisterPublication <MyEvent>( TestingConfiguration.ExchangeName, typeof(MyEvent).Name); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For <IConnectionManager>(); var _context = Substitute.For <IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); var _theEvent = new MyEvent(Guid.NewGuid(), null, "Some detail", 1); var _publicationResult = _SUT.PublishAsync(_theEvent); _publicationResult.Wait(); Assert.AreEqual(PMCG.Messaging.PublicationResultStatus.Blocked, _publicationResult.Result.Status); }
public void Interrupt() { Running.State = States.Blocked; Blocked.Enqueue(Running); memory.ChangeFramesState(Running, States.Blocked); // << }
public IActionResult ArrowEleven(int id) { var str = db.Complete.Where(x => x.Id == id).ToList(); foreach (var val in str) // iterator the data from the list and insert them into the listSecond { string Status = "Blocked"; Blocked ls = new Blocked(); ls.Id = val.Id; ls.Name = val.Name; ls.Status = Status; ls.Category = val.Category; ls.Owner = val.Owner; ls.Lead = val.Lead; ls.Budget = val.Budget; ls.Profit = val.Profit; db.Blocked.Add(ls); } db.SaveChanges(); db.Complete.Remove(db.Complete.Find(id)); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// Creates a new guild card data with the following <see cref="Blocked"/> users and /// <see cref="Friends"/>. /// </summary> /// <param name="blocked">The blocked users.</param> /// <param name="friends">The friends.</param> public GuildCardData([NotNull] GuildCardEntry[] blocked, [NotNull] GuildCardFriend[] friends) { Blocked = blocked ?? throw new ArgumentNullException(nameof(blocked)); Friends = friends ?? throw new ArgumentNullException(nameof(friends)); if (Blocked.Length > BLOCKED_SIZE) { throw new ArgumentException($"{nameof(blocked)} exceeds max size of: {BLOCKED_SIZE}", nameof(blocked)); } if (Friends.Length > FRIENDS_SIZE) { throw new ArgumentException($"{nameof(friends)} exceeds max size of: {FRIENDS_SIZE}", nameof(friends)); } if (Blocked.Length != BLOCKED_SIZE) { Blocked = Blocked .Concat(Enumerable.Repeat(GuildCardEntry.CreateEmpty(), Blocked.Length - BLOCKED_SIZE)) .ToArray(); } if (Friends.Length != FRIENDS_SIZE) { Friends = Friends .Concat(Enumerable.Repeat(GuildCardFriend.CreateEmpty(), Blocked.Length - FRIENDS_SIZE)) .ToArray(); } }
private void RemoveRelationship(DiscordRelationship rel, bool skipAll = false) { if (!skipAll) { if (_allList.Remove(rel)) { _syncContext.Post(a => All.Remove(rel), null); } } if (_onlineList.Remove(rel)) { _syncContext.Post(a => Online.Remove(rel), null); } if (Pending.Contains(rel)) // is this actually faster? { _syncContext.Post(a => Pending.Remove(rel), null); } if (Blocked.Contains(rel)) // ^^ { _syncContext.Post(a => Blocked.Remove(rel), null); } }
public void NextMove() { if (Blocked.Contains("oui") == true) { RandomDirection(); } Move(); }
public IActionResult Add(Blocked Blocked, AltProject AltProject) { db.Blocked.Add(Blocked); db.AltProject.Add(AltProject); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Can_create_blocked_Event() { var id = Guid.NewGuid(); var @event = new Blocked(id); Assert.NotNull(@event); Assert.Equal(id, @event.BlockedAccount); }
public void Deinterrupt() { var p = Blocked.Dequeue(); p.State = States.Ready; Ready.Enqueue(p); memory.ChangeFramesState(p, States.Ready); // << }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (Actions != null) { hashCode = hashCode * 59 + Actions.GetHashCode(); } if (Blocked != null) { hashCode = hashCode * 59 + Blocked.GetHashCode(); } if (Buildable != null) { hashCode = hashCode * 59 + Buildable.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (InQueueSince != null) { hashCode = hashCode * 59 + InQueueSince.GetHashCode(); } if (Params != null) { hashCode = hashCode * 59 + Params.GetHashCode(); } if (Stuck != null) { hashCode = hashCode * 59 + Stuck.GetHashCode(); } if (Task != null) { hashCode = hashCode * 59 + Task.GetHashCode(); } if (Url != null) { hashCode = hashCode * 59 + Url.GetHashCode(); } if (Why != null) { hashCode = hashCode * 59 + Why.GetHashCode(); } if (BuildableStartMilliseconds != null) { hashCode = hashCode * 59 + BuildableStartMilliseconds.GetHashCode(); } return(hashCode); } }
/// <summary> /// Deletes the base from the settings and from the obeservable collection /// </summary> public void Delete() { string oldSetting = Properties.Settings.Default[Setting].ToString(); Properties.Settings.Default[Setting] = oldSetting.Replace($";{SelectedItem}", ""); Properties.Settings.Default.Save(); Blocked.Remove(SelectedItem); }
public void RightAns() { ANS.text = "Right Answer"; Key.GetComponent <Key>().openDoor = true; SoundandMusic.SWIN = true; StartCoroutine("ClosePanel"); Key.SetActive(false); Blocked.SetActive(false); }
internal void SetBlockedObject(BaseObjectData bOD) { if (bOD == null || IsDisabled) { return; } DestroyGridObjects(); Blocked = BlockedObject.Create(this, bOD, MBoard.TargetCollectEventHandler); // sRenderer.sprite = bOD.ObjectImage; Blocked = Creator.CreateSprite(transform, bOD.ObjectImage, transform.position, SortingOrder.Blocked).gameObject; Blocked.SetToFront(false); }
public static void block(string msisdn) { Blocked userBlocked = new Blocked(msisdn); using (HikeUsersDb context = new HikeUsersDb(App.UsersDBConnectionstring)) { context.blockedUsersTable.InsertOnSubmit(userBlocked); SubmitWithConflictResolve(context); } }
public TurnChanged SetPlayerInputBlocked() { ClearStateVariables(); var newBlockedState = new Blocked(); var stateChanged = Next(newBlockedState); var turnChanged = new TurnChanged(stateChanged.FromStateName, stateChanged.ToStateName); return(turnChanged); }
public void Send() { if (BlockedList.Count <= 0) { return; } var allBlocked = GetBlockedInfo(new List <uint>(BlockedList.Keys)); var allBlockedArray = new Blocked[allBlocked.Count]; allBlocked.CopyTo(allBlockedArray, 0); Owner.SendPacket(new SCBlockedUsersPacket(allBlockedArray.Length, allBlockedArray)); }
/// <summary> /// Ads a base to the settings and the observable collection /// </summary> public void Add() { if (string.IsNullOrEmpty(Name)) { return; } string oldSetting = Properties.Settings.Default[Setting].ToString(); Properties.Settings.Default[Setting] = $"{oldSetting};{Name}"; Properties.Settings.Default.Save(); Blocked.Add(Name); }
public IActionResult Update(string id, Blocked blockedIn) { var blocked = _blockedService.Get(id); if (blocked == null) { return(NotFound()); } _blockedService.Update(id, blockedIn); return(NoContent()); }
private byte[] CreateMultiDeviceBlockedContent(BlockedListMessage blocked) { Content content = new Content { }; SyncMessage syncMessage = new SyncMessage { }; Blocked blockedMessage = new Blocked { }; blockedMessage.Numbers.AddRange(blocked.Numbers); syncMessage.Blocked = blockedMessage; content.SyncMessage = syncMessage; return(content.ToByteArray()); }
private void BlockFromDB(string uName, DateTime date, int inst, int dep, int yeId) { Blocked blocked = new Blocked() { UserName = uName, InsId = inst, DepId = dep, YearId = yeId, Bdate = date }; BlockedDal Bdal = new BlockedDal(); Bdal.Blockeds.Add(blocked); Bdal.SaveChanges(); }
public void UnblockUser(FriendModel user, [CanBeNull] Action <FriendModel> onSuccess = null, [CanBeNull] Action <Error> onError = null) { if (!Blocked.Contains(user)) { RaiseOnError($"Can not unblock user with this nickname = {user.Nickname}. This user is not in the list of blocked friends.", onError); } else { SdkFriendsLogic.Instance.UnblockUser(user, u => { RemoveUserFromMemory(user); onSuccess?.Invoke(u); }, onError); } }
public int CompareTo(RaceData other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var idComparison = Id.CompareTo(other.Id); if (idComparison != 0) { return(idComparison); } var raceIdComparison = RaceId.CompareTo(other.RaceId); if (raceIdComparison != 0) { return(raceIdComparison); } var skierIdComparison = SkierId.CompareTo(other.SkierId); if (skierIdComparison != 0) { return(skierIdComparison); } var disqualifiedComparison = Disqualified.CompareTo(other.Disqualified); if (disqualifiedComparison != 0) { return(disqualifiedComparison); } var runningComparison = Running.CompareTo(other.Running); if (runningComparison != 0) { return(runningComparison); } var blockedComparison = Blocked.CompareTo(other.Blocked); if (blockedComparison != 0) { return(blockedComparison); } return(Finished.CompareTo(other.Finished)); }
public void GetHit(object sender, DamageEventArgs args) { if (args.BodyPart == _blocked) { Blocked?.Invoke(this, new FighterEventArgs(HealthPoints, Name)); } else { HealthPoints -= args.Damage; if (!Dead) { Wounded?.Invoke(this, args); } } }
public void AddFriend(FriendModel user, [CanBeNull] Action <FriendModel> onSuccess = null, [CanBeNull] Action <Error> onError = null) { if (Friends.Contains(user) || Blocked.Contains(user) || Pending.Contains(user) || Requested.Contains(user)) { RaiseOnError($"Can not add friend with this nickname = {user.Nickname}. This friend is not in the 'initial' state.", onError); } else { SdkFriendsLogic.Instance.SendFriendshipInvite(user, u => { RemoveUserFromMemory(user); UpdateRequestedUsers(onError: onError); onSuccess?.Invoke(u); }, onError); } }
public void Connect_Results_In_An_Invalid_Operation_Exception() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For<IConnectionManager>(); var _context = Substitute.For<IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); _SUT.Connect(); }
public void Publish_Where_No_Publication_Configurations_Which_Results_In_A_NoConfigurationFound_Result() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For<IConnectionManager>(); //var _connection = Substitute.For<IConnection>(); var _context = Substitute.For<IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); var _theEvent = new MyEvent(Guid.NewGuid(), null, "Some detail", 1); var _publicationResult = _SUT.PublishAsync(_theEvent); _publicationResult.Wait(); Assert.AreEqual(PMCG.Messaging.PublicationResultStatus.NoConfigurationFound, _publicationResult.Result.Status); }
public void Close_Results_In_Transition_To_Closed_State() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For<IConnectionManager>(); var _context = Substitute.For<IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); _context.State.Returns(callInfo => _SUT); State _capturedState = null; _context.When(context => context.State = Arg.Any<State>()).Do(callInfo => _capturedState = callInfo[0] as State); _SUT.Close(); Assert.IsInstanceOf<Closed>(_capturedState); _connectionManager.Received().Close(); }
public void Publish_Where_Publication_Configurations_Exist_Which_Results_In_Blocked_Result() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); _busConfigurationBuilder .RegisterPublication<MyEvent>( TestingConfiguration.ExchangeName, typeof(MyEvent).Name); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For<IConnectionManager>(); var _context = Substitute.For<IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); var _theEvent = new MyEvent(Guid.NewGuid(), null, "Some detail", 1); var _publicationResult = _SUT.PublishAsync(_theEvent); _publicationResult.Wait(); Assert.AreEqual(PMCG.Messaging.PublicationResultStatus.Blocked, _publicationResult.Result.Status); }
public void State_Changed_Where_Connection_Is_Unblocked_Results_In_Transition_To_Connected_State() { var _busConfigurationBuilder = new BusConfigurationBuilder(); _busConfigurationBuilder.ConnectionUris.Add(TestingConfiguration.LocalConnectionUri); var _busConfirguration = _busConfigurationBuilder.Build(); var _connectionManager = Substitute.For<IConnectionManager>(); var _connection = Substitute.For<IConnection>(); var _context = Substitute.For<IBusContext>(); var _SUT = new Blocked( _busConfirguration, _connectionManager, _context); _context.State.Returns(callInfo => _SUT); State _capturedState = null; _context.When(context => context.State = Arg.Any<State>()).Do(callInfo => _capturedState = callInfo[0] as State); _connectionManager.Unblocked += Raise.Event<EventHandler<EventArgs>>(_connection, new EventArgs()); Assert.IsInstanceOf<Connected>(_capturedState); }