Ejemplo n.º 1
0
        public void RemoveOwner(RemoveReason reason)
        {
            if (this.Owner == null)
            {
                return;
            }

            RemoveMember(this.Owner, reason, false);
            this.Owner = null;
        }
Ejemplo n.º 2
0
 protected override void OnRemove(DependencyObject view, RemoveReason reason)
 {
     view.As <MenuItem>(e =>
     {
         if (this.Element.Items.Contains(e))
         {
             this.Element.Items.Remove(e);
         }
     });
 }
Ejemplo n.º 3
0
    public async Task <bool> Remove1(Token desiredToken, RemoveReason reason)
    {
        if (!Frozen && 0 < _tokens[desiredToken])
        {
            await _tokens.Remove(desiredToken, 1, reason);

            return(true);
        }

        return(false);        // unable to remove desired token
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Removes a CSS class from a class attribute.
        /// </summary>
        /// <param name="tag">Tag the style belongs to</param>
        /// <param name="cssClass">Class to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveCssClass(IElement tag, string cssClass, RemoveReason reason)
        {
            var e = new RemovingCssClassEventArgs {
                Tag = tag, CssClass = cssClass, Reason = reason
            };

            OnRemovingCssClass(e);
            if (!e.Cancel)
            {
                tag.ClassList.Remove(cssClass);
            }
        }
Ejemplo n.º 5
0
        public void Remove(Allocation oldAllocation, RemoveReason reason)
        {
            lock (syncRoot)
            {
                byAllocated.Remove(oldAllocation.Alocated);
                byReal.Remove(oldAllocation.Real);
                byConnectionId.Remove(oldAllocation.ConnectionId);
                byKey.Remove(GetKey(oldAllocation.Local, oldAllocation.Reflexive));
            }

            OnRemoved(oldAllocation, reason);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Removes an attribute from the document.
        /// </summary>
        /// <param name="tag">Tag the attribute belongs to</param>
        /// <param name="attribute">Attribute to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveAttribute(IElement tag, IAttr attribute, RemoveReason reason)
        {
            var e = new RemovingAttributeEventArgs {
                Tag = tag, Attribute = attribute, Reason = reason
            };

            OnRemovingAttribute(e);
            if (!e.Cancel)
            {
                tag.RemoveAttribute(attribute.Name);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Removes a tag from the document.
        /// </summary>
        /// <param name="tag">Tag to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveTag(IElement tag, RemoveReason reason)
        {
            var e = new RemovingTagEventArgs {
                Tag = tag, Reason = reason
            };

            OnRemovingTag(e);
            if (!e.Cancel)
            {
                tag.Remove();
            }
        }
Ejemplo n.º 8
0
 private void ItemRemovedCallback(object key, object value, RemoveReason removedReason, object state)
 {
     //if the item was removed from the cache, log the key and reason to the event log
     try
     {
         _logger.LogInformation("ItemRemovedCallback:key:" + key + ", reason:" + removedReason.ToString());
     }
     catch (Exception exc)
     {
         //Swallow exception
         _logger.LogError(exc, "ItemRemovedCallbackError");
     }
 }
    public override async Task Remove(int count, RemoveReason reason)
    {
        // Remove real Badlands first
        int realBadlands          = base.Count;
        int realBandlandsToRemove = System.Math.Min(realBadlands, count);
        await base.Remove(realBandlandsToRemove, reason);

        // if any left over, remove the blight instead
        int blightToRemove = count - realBandlandsToRemove;
        await blight.Remove(blightToRemove, reason);

        // !! doesn't go back to the card - should it?
        // !!! also not sure what happens if they try to move a badland
    }
Ejemplo n.º 10
0
    /// <summary> Returns the Token removed </summary>
    public async Task <Token> Remove1(RemoveReason reason)
    {
        if (Frozen)
        {
            return(null);
        }

        var toRemove = Keys.OrderBy(x => x.RemainingHealth).FirstOrDefault();

        if (toRemove != null)
        {
            await _tokens.Remove(toRemove, 1, reason);
        }
        return(toRemove);
    }
Ejemplo n.º 11
0
        [Authorize] public ActionResult Edit(RemoveReason obj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    dbActionResult resultAction = new dbActionResult();
                    resultAction = db.EditRemoveReason(obj);
                    int id = resultAction.intResult;
                    if (id >= 0)
                    {
                        return(RedirectToAction("Index"));
                    }

                    if (id == -1)
                    {
                        db.DetachRemoveReason(obj);
                        RemoveReason oldObj = db.GetRemoveReason(obj.RemoveReasonID);
                        ModelState.AddModelError("", "Ошибка параллельного доступа к данным. Если проблема повторится, обратитесь к системному администратору.");
                        if (oldObj.Code != obj.Code)
                        {
                            ModelState.AddModelError("Code", "Текущее значение: " + oldObj.Code.ToString());
                        }
                        if (oldObj.DescriptionEng != obj.DescriptionEng)
                        {
                            ModelState.AddModelError("DescriptionEng", "Текущее значение: " + oldObj.DescriptionEng.ToString());
                        }
                        if (oldObj.DescriptionRus.ToString() != obj.DescriptionRus.ToString())
                        {
                            ModelState.AddModelError("DescriptionRus", "Текущее значение: " + oldObj.DescriptionRus.ToString());
                        }
                        obj.Timestamp = oldObj.Timestamp;
                    }
                    if (id == -2)
                    {
                        ModelState.AddModelError("", resultAction.exData.Message.ToString() + " | " + resultAction.exData.GetType().ToString() + " | " +
                                                 "Невозможно сохранить изменения. Нажмите обновить страницу и повторить действия. Если проблема повторится, обратитесь к системному администратору.");
                    }
                }
            }

            catch (DataException ex)
            {
                ModelState.AddModelError("", ex.Message.ToString() + " | " + ex.GetType().ToString() + " | " + "Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
            }

            return(View(obj));
        }
Ejemplo n.º 12
0
 [Authorize] public ActionResult Create(RemoveReason obj)
 {
     try
     {
         if (ModelState.IsValid)
         {
             int id = db.AddRemoveReason(obj);
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException ex)
     {
         ModelState.AddModelError("", ex.Message.ToString() + " Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 13
0
    public RemoveAction(Board board, int x, int y, RemoveReason reasonForRemove = RemoveReason.Destroy)
        : base(board)
    {
        this.x            = x;
        this.y            = y;
        this.tile         = board.GetTile(x, y);
        this.removeReason = reasonForRemove;

        // data logic
        if (reasonForRemove == RemoveReason.PlayerInput)
        {
            this.tile.DestroyTile();
        }

        board.SetTileType(x, y, TileTypes.None);

        board.SetTile(x, y, null);
    }
Ejemplo n.º 14
0
        public void RemoveMember(MooNetClient client, RemoveReason reason, bool dissolving)
        {
            if (client.CurrentToon == null)
            {
                Logger.Warn("Could not remove toon-less client {0}", client.Connection.RemoteEndPoint.ToString());
                return;
            }
            else if (!HasUser(client))
            {
                Logger.Warn("Attempted to remove non-member client {0} from channel", client.Connection.RemoteEndPoint.ToString());
                return;
            }
            else if (client.CurrentChannel != this)
            {
                Logger.Warn("Client {0} is being removed from a channel that is not its current one..", client.Connection.RemoteEndPoint.ToString());
            }
            var memberId = this.Members[client].Identity.ToonId;
            var message  = bnet.protocol.channel.RemoveNotification.CreateBuilder()
                           .SetMemberId(memberId)
                           .SetReason((uint)reason)
                           .Build();

            //Logger.Debug("NotifyRemove message:\n{0}", message.ToString());

            foreach (var pair in this.Members)
            {
                pair.Key.MakeTargetedRPC(this, () =>
                                         bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifyRemove(null, message, callback => { }));
            }

            this.Members.Remove(client);
            client.CurrentChannel = null;

            if (client == this.Owner)
            {
                this.Owner = null;
            }

            if (this.Members.Count == 0 && !dissolving)
            {
                Dissolve();
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Removes a tag from the document.
        /// </summary>
        /// <param name="tag">Tag to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveTag(IElement tag, RemoveReason reason)
        {
            var e = new RemovingTagEventArgs {
                Tag = tag, Reason = reason
            };

            OnRemovingTag(e);
            if (!e.Cancel)
            {
                if (KeepChildNodes && tag.HasChildNodes)
                {
                    tag.Replace(tag.ChildNodes.ToArray());
                }
                else
                {
                    tag.Remove();
                }
            }
        }
Ejemplo n.º 16
0
 private void OnKeyToRemoveBudgetsCacheValueRemoved(string key, string value, RemoveReason reason)
 {
     lock (this.instanceLock)
     {
         if (reason != RemoveReason.Removed)
         {
             ExTraceGlobals.PublicPluginAPITracer.TraceDebug <string, RemoveReason>(0L, "Key {0} is removed from budgets dictionary after timeout. Remove reason = {1}", key, reason);
             if (!BudgetManager.NormalCleanupCacheValue.Equals(value))
             {
                 this.RunspacesLeakDetected(key, value);
             }
             this.budgets.Remove(key);
         }
     }
     if (reason != RemoveReason.Removed)
     {
         this.UpdateBudgetsPerfCounter(this.budgets.Count);
         AuthZPluginHelper.UpdateAuthZPluginPerfCounters(this);
     }
     this.UpdateKeyToRemoveBudgetsPerfCounter(this.keyToRemoveBudgets.Count);
 }
		/// <summary>
		/// Removes the specified view.
		/// </summary>
		/// <param name="view">The view.</param>
		/// <param name="reason">The reason.</param>
		protected void Remove( DependencyObject view, RemoveReason reason )
		{
			var args = new CancelEventArgs()
			{
				Cancel = false
			};

#if !SILVERLIGHT

			RegionService.Conventions
                .GetViewDataContext( view, RegionService.Conventions.DefaultViewDataContextSearchBehavior )
				.As<IExpectViewClosingCallback>( i => i.OnViewClosing( args ) );

#endif

			if ( !args.Cancel )
			{
				this.OnRemove( view, reason );
				this.views.Remove( view );
				this.OnRemoved( view, reason );
			}
		}
Ejemplo n.º 18
0
        /// <summary>
        /// Removes a style from the document.
        /// </summary>
        /// <param name="tag">Tag the style belongs to</param>
        /// <param name="styles">Style rule that contains the style to be removed</param>
        /// <param name="style">Style to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveStyle(IElement tag, ICssStyleDeclaration styles, ICssProperty style, RemoveReason reason)
        {
            var e = new RemovingStyleEventArgs {
                Tag = tag, Style = style, Reason = reason
            };

            OnRemovingStyle(e);
            if (!e.Cancel)
            {
                styles.RemoveProperty(style.Name);
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemovingStyleEventArgs"/> class.
 /// </summary>
 /// <param name="tag">The element containing the attribute.</param>
 /// <param name="style">The style to be removed.</param>
 /// <param name="reason">The reason why the attribute will be removed.</param>
 public RemovingStyleEventArgs(IElement tag, ICssProperty style, RemoveReason reason)
 {
     Tag    = tag;
     Style  = style;
     Reason = reason;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemovingTagEventArgs"/> class.
 /// </summary>
 /// <param name="tag">The element to be removed.</param>
 /// <param name="reason">The reason why the tag will be removed.</param>
 public RemovingTagEventArgs(IElement tag, RemoveReason reason)
 {
     Tag    = tag;
     Reason = reason;
 }
Ejemplo n.º 21
0
 public void RemoveMember(BNetClient client, RemoveReason reason)
 {
     if (client.CurrentToon == null)
     {
         Logger.Warn("Could not remove toon-less client {0}", client.Connection.RemoteEndPoint.ToString());
         return;
     }
     else if (!HasUser(client))
     {
         Logger.Warn("Attempted to remove non-member client {0} from channel", client.Connection.RemoteEndPoint.ToString());
         return;
     }
     else if (client.CurrentChannel != this)
     {
         Logger.Warn("Client {0} is being removed from a channel that is not its current one..", client.Connection.RemoteEndPoint.ToString());
     }
     var memberId = this.Members[client].Identity.ToonId;
     var message = bnet.protocol.channel.RemoveNotification.CreateBuilder()
         .SetMemberId(memberId)
         .SetReason((uint)reason)
         .Build();
     //Logger.Debug("NotifyRemove message:\n{0}", message.ToString());
     var method = bnet.protocol.channel.ChannelSubscriber.Descriptor.FindMethodByName("NotifyRemove");
     foreach (var pair in this.Members) //.Where(m => m.Value.Identity != client.Identity(false, false, true))
     {
         pair.Key.CallMethod(method, message, this.DynamicId);
     }
     this.Members.Remove(client);
     client.CurrentChannel = null;
 }
Ejemplo n.º 22
0
 public void RemoveMember(BNetClient client, RemoveReason reason)
 {
     RemoveMember(client, reason, false);
 }
Ejemplo n.º 23
0
 // Token: 0x0600090B RID: 2315 RVA: 0x00023C9C File Offset: 0x00021E9C
 private void HandleRemoveRegistration(string key, BaseConditionalRegistration value, RemoveReason reason)
 {
     ExTraceGlobals.DiagnosticHandlersTracer.TraceDebug <string, RemoveReason, string>((long)this.GetHashCode(), "[ConditionalRegistrationCache.HandleRemoveRegistration] Cookie: {0} was removed for reason {1}.  Description: '{2}'", key, reason, value.Description ?? "<NULL>");
     if (ConditionalRegistrationCache.TESTHOOK_DeleteRegistration == null)
     {
         ConditionalRegistrationLog.DeleteRegistration(key);
     }
     else
     {
         ConditionalRegistrationCache.TESTHOOK_DeleteRegistration(key);
     }
     this.UpdateActiveProperties(value, false);
     if (value.OnExpired != null)
     {
         value.OnExpired(value, reason);
     }
 }
Ejemplo n.º 24
0
 public void RemoveMember(BNetClient client, RemoveReason reason)
 {
     RemoveMember(client, reason, false);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Remove a tag from the document.
 /// </summary>
 /// <param name="tag">to be removed</param>
 /// <param name="reason">reason why to be removed</param>
 private void RemoveTag(IElement tag, RemoveReason reason)
 {
     var e = new RemovingTagEventArgs { Tag = tag, Reason = reason };
     OnRemovingTag(e);
     if (!e.Cancel) tag.Remove();
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Remove a style from the document.
 /// </summary>
 /// <param name="tag">tag where the style belongs</param>
 /// <param name="styles">collection where the style to belongs</param>
 /// <param name="style">to be removed</param>
 /// <param name="reason">reason why to be removed</param>
 private void RemoveStyle(IElement tag, ICssStyleDeclaration styles, ICssProperty style, RemoveReason reason)
 {
     var e = new RemovingStyleEventArgs { Tag = tag, Style = style, Reason = reason };
     OnRemovingStyle(e);
     if (!e.Cancel) styles.RemoveProperty(style.Name);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Remove an attribute from the document.
 /// </summary>
 /// <param name="tag">tag where the attribute to belongs</param>
 /// <param name="attribute">to be removed</param>
 /// <param name="reason">reason why to be removed</param>
 private void RemoveAttribute(IElement tag, IAttr attribute, RemoveReason reason)
 {
     var e = new RemovingAttributeEventArgs { Tag = tag, Attribute = attribute, Reason = reason };
     OnRemovingAttribute(e);
     if (!e.Cancel) tag.RemoveAttribute(attribute.Name);
 }
Ejemplo n.º 28
0
 // Remove:
 // override by trickster
 public override Task Remove(int count, RemoveReason reason = RemoveReason.Removed)
 {
     return(base.Remove(count, reason));
 }
Ejemplo n.º 29
0
 static public bool IsDestroy(this RemoveReason reason) => reason == RemoveReason.Destroyed || reason == RemoveReason.DestroyedInBattle;
Ejemplo n.º 30
0
 private void OnRemoved(Allocation allocation, RemoveReason reason)
 {
     Removed(allocation, reason);
 }
Ejemplo n.º 31
0
 public void RemoveMemberByID(bnet.protocol.EntityId memberId, RemoveReason reason)
 {
     var client = this.Members.FirstOrDefault(pair => pair.Value.Identity.ToonId == memberId).Key;
     RemoveMember(client, reason);
 }
Ejemplo n.º 32
0
 private static void RemoveReservationCallback(Guid reservationID, ReservationBase reservation, RemoveReason reason)
 {
     lock (ReservationManager.Locker)
     {
         if (!reservation.IsDisposed)
         {
             reservation.Dispose();
         }
     }
 }
Ejemplo n.º 33
0
 public void RemoveOwner(RemoveReason reason)
 {
     if (this.Owner != null)
     {
         RemoveMember(this.Owner, reason);
     }
 }
Ejemplo n.º 34
0
        public void Remove(Allocation oldAllocation, RemoveReason reason)
        {
            lock (syncRoot)
            {
                byAllocated.Remove(oldAllocation.Alocated);
                byReal.Remove(oldAllocation.Real);
                byConnectionId.Remove(oldAllocation.ConnectionId);
                byKey.Remove(GetKey(oldAllocation.Local, oldAllocation.Reflexive));
            }

            OnRemoved(oldAllocation, reason);
        }
Ejemplo n.º 35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemovingAttributeEventArgs"/> class.
 /// </summary>
 /// <param name="tag">The element containing the attribute.</param>
 /// <param name="attribute">The attribute to be removed.</param>
 /// <param name="reason">The reason why the attribute will be removed.</param>
 public RemovingAttributeEventArgs(IElement tag, IAttr attribute, RemoveReason reason)
 {
     Tag       = tag;
     Attribute = attribute;
     Reason    = reason;
 }
Ejemplo n.º 36
0
        public void RemoveOwner(RemoveReason reason)
        {
            if (this.Owner == null) return;

            RemoveMember(this.Owner, reason, false);
            this.Owner = null;
        }
Ejemplo n.º 37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemovingCssClassEventArgs"/> class.
 /// </summary>
 /// <param name="tag">The element containing the attribute.</param>
 /// <param name="cssClass">The CSS class to be removed.</param>
 /// <param name="reason">The reason why the attribute will be removed.</param>
 public RemovingCssClassEventArgs(IElement tag, string cssClass, RemoveReason reason)
 {
     Tag      = tag;
     CssClass = cssClass;
     Reason   = reason;
 }
Ejemplo n.º 38
0
        public void RemoveMember(MooNetClient client, RemoveReason reason, bool dissolving)
        {
            if (client.Account.CurrentGameAccount == null)
            {
                Logger.Warn("Could not remove client {0} from channel {1}.", client.Connection.RemoteEndPoint.ToString(), this.ToString());
                return;
            }
            else if (!HasUser(client))
            {
                Logger.Warn("Attempted to remove non-member client {0} from channel {1}.", client.Connection.RemoteEndPoint.ToString(), this.ToString());
                return;
            }
            else if (!client.Channels.ContainsValue(this))
            {
                Logger.Warn("Client {0} being removed from a channel ({1}) he's not associated with.", client.Connection.RemoteEndPoint.ToString(), this.ToString());
            }
            //else if (client.CurrentChannel != this)
            //{
            //    Logger.Warn("Client {0} is being removed from a channel ({1}) that is not its current one.", client.Connection.RemoteEndPoint.ToString(), this.ToString());
            //}
            var memberId = this.Members[client].Identity.GameAccountId;
            var message = bnet.protocol.channel.RemoveNotification.CreateBuilder()
                .SetAgentId(memberId)  //is this channel owner, member being removed or the one requesting removal of member? -Egris
                .SetMemberId(memberId)
                .SetReason((uint)reason)
                .Build();

            //Logger.Debug("NotifyRemove message:\n{0}", message.ToString());

            foreach (var pair in this.Members)
            {
                pair.Key.MakeTargetedRPC(this, () =>
                    bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifyRemove(null, message, callback => { }));
            }

            this.Members.Remove(client);
            client.CurrentChannel = null;
            //client.Channels.Remove(this.DynamicId); //Add this when CurrentChannel is fully removed from code -Egris
            if (this.IsGameChannel)
            {
                client.GameChannel = null;
                Logger.Warn("Client {0} left game channel {1}.", client, this);
            }
            else
            {
                client.PartyChannel = null;
                Logger.Warn("Client {0} left party channel {1}.", client, this);
            }

            if (client == this.Owner)
                this.Owner = null;

            if (this.Members.Count == 0 && !dissolving)
                Dissolve();
        }
Ejemplo n.º 39
0
        public void RemoveMember(MooNetClient client, RemoveReason reason, bool dissolving)
        {
            if (client.CurrentToon == null)
            {
                Logger.Warn("Could not remove toon-less client {0}", client.Connection.RemoteEndPoint.ToString());
                return;
            }
            else if (!HasUser(client))
            {
                Logger.Warn("Attempted to remove non-member client {0} from channel", client.Connection.RemoteEndPoint.ToString());
                return;
            }
            else if (client.CurrentChannel != this)
            {
                Logger.Warn("Client {0} is being removed from a channel that is not its current one..", client.Connection.RemoteEndPoint.ToString());
            }
            var memberId = this.Members[client].Identity.ToonId;
            var message = bnet.protocol.channel.RemoveNotification.CreateBuilder()
                .SetMemberId(memberId)
                .SetReason((uint)reason)
                .Build();

            //Logger.Debug("NotifyRemove message:\n{0}", message.ToString());

            foreach (var pair in this.Members)
            {
                pair.Key.MakeTargetedRPC(this, () =>
                    bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifyRemove(null, message, callback => { }));
            }

            this.Members.Remove(client);
            client.CurrentChannel = null;

            if (client == this.Owner)
                this.Owner = null;

            if (this.Members.Count == 0 && !dissolving)
                Dissolve();
        }
Ejemplo n.º 40
0
 public RemoveInfo(RemoveReason Reason, string message)
 {
     this.Reason  = Reason;
     this.Message = message ?? string.Empty;
 }
Ejemplo n.º 41
0
 private static void RemovePerfCounter(Guid mdbGuid, MDBPerfCounterHelper perfCounter, RemoveReason reason)
 {
     perfCounter.RemovePerfCounter();
 }
Ejemplo n.º 42
0
        // Token: 0x060012D6 RID: 4822 RVA: 0x0003D31C File Offset: 0x0003B51C
        private void OnUserRemovedFromCache(string key, AuthZPluginUserToken userToken, RemoveReason reason)
        {
            ExTraceGlobals.PublicPluginAPITracer.TraceDebug <string, string, RemoveReason>(0L, "User token {0} with key {1} removed from cache. Reason: {2}.", userToken.UserName, key.ToString(), reason);
            RemotePowershellPerformanceCountersInstance remotePowershellPerfCounter = ExchangeAuthorizationPlugin.RemotePowershellPerfCounter;

            if (remotePowershellPerfCounter != null)
            {
                remotePowershellPerfCounter.AuthenticatedUserCacheSize.RawValue = (long)base.Count;
            }
        }