コード例 #1
0
        private void RemoveWithDelay(
            IEnumerable <Notification> items,
            Action <Notification> onBeforeDelay,
            RemovedBy removedBy,
            int millisecondDelay)
        {
            foreach (var item in items)
            {
                onBeforeDelay(item);
            }

            TaskUtilities
            .Delay(millisecondDelay)
            .ContinueWith(() =>
            {
                foreach (var item in items)
                {
                    var removed = collection.Remove(item);
                    if (removed)
                    {
                        OnRemoved(item, removedBy);
                    }
                }
            },
                          taskScheduler);
        }
コード例 #2
0
 private void RemoveWithDelay(
     Notification notification,
     Action <Notification> onBeforeDelay,
     RemovedBy removedBy,
     int millisecondDelay)
 {
     RemoveWithDelay(new[] { notification }, onBeforeDelay, removedBy, millisecondDelay);
 }
コード例 #3
0
        public void Remove(Notification notification, RemovedBy removedBy)
        {
            var removed = collection.Remove(notification);

            if (removed)
            {
                OnRemoved(notification, removedBy);
            }
        }
コード例 #4
0
        private void OnRemoved(Notification notification, RemovedBy removedBy)
        {
            var onRemoved = Removed;

            if (onRemoved != null)
            {
                onRemoved(this, new NotificationRemovedArgs {
                    Notification = notification, RemovedBy = removedBy
                });
            }
        }
コード例 #5
0
ファイル: Enumerant.cs プロジェクト: ipud2/OpenGL.Net-1
        /// <summary>
        /// Link other information against this enumerant.
        /// </summary>
        /// <param name="ctx">
        /// A <see cref="RegistryContext"/> holding the registry information to link.
        /// </param>
        internal void Link(RegistryContext ctx)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException(nameof(ctx));
            }

            RequiredBy.Clear();
            RequiredBy.AddRange(GetFeaturesRequiringEnum(ctx));

            RemovedBy.Clear();
            RemovedBy.AddRange(GetFeaturesRemovingEnum(ctx));
        }
コード例 #6
0
ファイル: Command.cs プロジェクト: vazgriz/OpenGL.Net
        /// <summary>
        /// Link other information against this enumerant.
        /// </summary>
        /// <param name="ctx">
        /// A <see cref="RegistryContext"/> holding the registry information to link.
        /// </param>
        internal void Link(RegistryContext ctx)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException("ctx");
            }

            RequiredBy.Clear();
            RequiredBy.AddRange(GetFeaturesRequiringCommand(ctx));

            RemovedBy.Clear();
            RemovedBy.AddRange(GetFeaturesRemovingCommand(ctx));

            foreach (CommandParameter commandParameter in Parameters)
            {
                commandParameter.ParentCommand = this;
            }
        }
コード例 #7
0
 public void RemoveWithDelay(IEnumerable <Notification> items, RemovedBy removedBy)
 {
     RemoveWithDelay(items, item => item.IsRemoving = true, removedBy, 200);
 }
コード例 #8
0
 public void RemoveWithDelay(Notification notification, RemovedBy removedBy)
 {
     RemoveWithDelay(notification, item => item.IsRemoving = true, removedBy, 200);
 }