Example #1
0
        public IActionResult Edit(int id, Blocked Blocked)
        {
            db.Entry(Blocked).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Example #2
0
        public void Block()
        {
            IsBlocked       = true;
            this.fade.color = this.fade.color.With(a: 0.75f);

            Blocked?.Invoke(this);
        }
Example #3
0
 /// <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;
 }
Example #5
0
        public IActionResult Add(Blocked Blocked)
        {
            db.Blocked.Add(Blocked);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Example #6
0
        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();
            }
        }
Example #7
0
        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);
        }
Example #8
0
        public void Interrupt()
        {
            Running.State = States.Blocked;

            Blocked.Enqueue(Running);
            memory.ChangeFramesState(Running, States.Blocked); // <<
        }
Example #9
0
        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"));
        }
Example #10
0
        /// <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();
            }
        }
Example #11
0
        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);
            }
        }
Example #12
0
 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"));
        }
Example #14
0
        public void Can_create_blocked_Event()
        {
            var id     = Guid.NewGuid();
            var @event = new Blocked(id);

            Assert.NotNull(@event);
            Assert.Equal(id, @event.BlockedAccount);
        }
Example #15
0
        public void Deinterrupt()
        {
            var p = Blocked.Dequeue();

            p.State = States.Ready;

            Ready.Enqueue(p);
            memory.ChangeFramesState(p, States.Ready); // <<
        }
Example #16
0
 /// <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);
     }
 }
Example #17
0
        /// <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);
 }
Example #19
0
 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);
 }
Example #20
0
        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);
    }
Example #22
0
        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));
        }
Example #23
0
        /// <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);
        }
Example #24
0
        public IActionResult Update(string id, Blocked blockedIn)
        {
            var blocked = _blockedService.Get(id);

            if (blocked == null)
            {
                return(NotFound());
            }

            _blockedService.Update(id, blockedIn);

            return(NoContent());
        }
Example #25
0
        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());
        }
Example #26
0
        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();
        }
Example #27
0
 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);
     }
 }
Example #28
0
        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));
        }
Example #29
0
 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);
         }
     }
 }
Example #30
0
 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);
     }
 }
Example #31
0
		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();
		}
Example #32
0
		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);
		}
Example #33
0
		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();
		}
Example #34
0
		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);
		}
Example #35
0
		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);
		}