示例#1
0
        public new void Remove(int id)
        {
            var student = this[id];

            base.Remove(id);
            OnRemove?.Invoke(id, student);
        }
 internal void RaiseOnRemove(string sender = null, OnRemovedataType data = null)
 {
     if (OnRemove != null)
     {
         OnRemove.BeginInvoke(sender, data, null, null);
     }
 }
示例#3
0
        public void ProcessQueue()
        {
            Dictionary <Guid, ToDoItem> items = new Dictionary <Guid, ToDoItem>();
            ToDoItem toDoItem;

            while (queue.TryDequeue(out toDoItem))
            {
                items[toDoItem.EditId] = toDoItem;
            }

            foreach (var item in items)
            {
                ToDoItemEventArgs args = new ToDoItemEventArgs
                {
                    Item = item.Value
                };

                if (item.Value.MarkedForRemoval)
                {
                    // TODO: Remove from database here

                    OnRemove?.Invoke(this, args);
                    continue;
                }
                // TODO: Database Update Here
                // TEMP
                if (item.Value.Id == 0)
                {
                    item.Value.Id = rd.Next(1, 9999);
                    OnCreate?.Invoke(this, args);
                }

                OnUpdate?.Invoke(this, args);
            }
        }
示例#4
0
        protected bool SendOnRemove(int index)
        {
            bool doIt = true;

            if (null != OnRemove)
            {
                foreach (EventHandler <CancelSelectEventArgs <int> > inv in OnRemove.GetInvocationList())
                {
                    try
                    {
                        CancelSelectEventArgs <int> args = new CancelSelectEventArgs <int>(index);
                        inv(this, args);
                        if (args.Cancel)
                        {
                            doIt = false;
                        }
                    }
                    catch (Exception exception)
                    {
                        Log.postException(exception);
                    }
                }
            }
            return(doIt);
        }
        //----------------------------------------//
        //-----         FUNÇÕES              -----//
        //----------------------------------------//

        protected override void _Update(GameTime gameTime)
        {
            delayTime += gameTime.ElapsedGameTime.Milliseconds;

            if (delayTime >= Delay)
            {
                Ghost ghost = new Ghost();
                ghost.Sprite     = entity.CurrentAnimation.CurrentSprite;
                ghost.Frame      = entity.CurrentAnimation.CurrentFrame;
                ghost.Position   = entity.Transform.Position;
                ghost.Rotation   = entity.Transform.Rotation;
                ghost.Scale      = entity.Transform.Scale;
                ghost.LayerDepth = entity.Transform.LayerDepth;
                ghost.Effects    = entity.Transform.SpriteEffects;
                ghost.Origin     = entity.Transform.Origin;

                ghosts.Add(ghost);
                delayTime = 0;

                OnCreate?.Invoke(entity, ghost);
            }

            for (int i = 0; i < ghosts.Count; i++)
            {
                ghosts[i].ElapsedTime += gameTime.ElapsedGameTime.Milliseconds;

                if (ghosts[i].ElapsedTime >= Time)
                {
                    OnRemove?.Invoke(entity, ghosts[i]);
                    ghosts.RemoveAt(i);
                }
            }
        }
示例#6
0
        public override bool Remove(Key key, out Element element)
        {
            bool success = Peek(key, out element);

            OnRemove?.Invoke(key, element);
            return(success);
        }
示例#7
0
 public void RemovePerson(Person person)
 {
     if (OnRemove != null)
     {
         OnRemove.Invoke(person);
     }
 }
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (OnRemove != null)
     {
         OnRemove.Invoke(sender, e);
     }
 }
示例#9
0
        async void OnDeleteExecute()
        {
            if (!ServiceProvider.MessageProvider.ShowYesNo($"Are you sure you want to Delete: {FilePath}?", "Confirm Deletion"))
            {
                return;
            }

            try
            {
                if (ItemType == RecentItemType.Link && !string.IsNullOrWhiteSpace(DeleteHash))
                {
                    await ServiceProvider.Get <ImgurWriter>().DeleteUploadedFile(DeleteHash);
                }
                else
                {
                    File.Delete(FilePath);
                }
            }
            catch (Exception e)
            {
                ServiceProvider.MessageProvider.ShowException(e, $"Could not Delete: {FilePath}");

                return;
            }

            // Remove from List
            OnRemove?.Invoke();
        }
示例#10
0
 public void Execute(World world)
 {
     OnReplace?.Invoke(world);
     OnRemove?.Invoke(world);
     OnCreate?.Invoke(world);
     OnSeed?.Invoke(world);
 }
示例#11
0
        public override bool Remove(Element element)
        {
            bool success = base.Remove(element);

            OnRemove?.Invoke(element);
            return(success);
        }
示例#12
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (OnRemove != null)
     {
         OnRemove.Invoke(this, null);
     }
 }
示例#13
0
        private void RaiseEvents(Operation op, int itemIndex, T oldItem, T newItem)
        {
            switch (op)
            {
            case Operation.OP_ADD:
                OnInsert?.Invoke(objects.Count - 1, newItem);
                break;

            case Operation.OP_CLEAR:
                OnClear?.Invoke();
                break;

            case Operation.OP_INSERT:
                OnInsert?.Invoke(itemIndex, newItem);
                break;

            case Operation.OP_REMOVEAT:
                OnRemove?.Invoke(itemIndex, oldItem);
                break;

            case Operation.OP_SET:
                OnSet?.Invoke(itemIndex, oldItem, newItem);
                break;
            }
        }
        public void Remove(string key)
        {
            VerifyInstance();
            _inner.Remove(key.ToLower());

            OnRemove?.Invoke(new CacheEventArgs(CacheOperation.Remove, key, CacheKeyHelper.GetResourceKeyFromCacheKey(key)));
        }
示例#15
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     if (BindingContext is BudgetSubcatEdit data)
     {
         OnRemove?.Invoke(this, data);
     }
 }
示例#16
0
 public void InvokeOnRemove(object item, object index)
 {
     if (OnRemove != null)
     {
         OnRemove.Invoke(this, new KeyValueEventArgs <T, string>((T)item, (string)index));
     }
 }
示例#17
0
        public void Remove()
        {
            if (bot)
            {
                bots--;
            }
            ActiveKeys.Remove(KeyCode);
            InactiveKeys.Remove(KeyCode);
            HEADS.Remove(KeyCode);
            key.Remove();
            Map.OnClear      -= clear;
            Map.OnStartGame  -= Reset;
            Map.OnStartRound -= Revive;
            OnUpdate         -= e_update;
            if (AnimationsEnabled)
            {
                window.DrawHead -= draw_event;
            }

            OnRemove?.Invoke();
            OnRemove = null;

            Map.SetMaxPoints();
            try {
                IKey.WIDTH = W / (float)ActiveKeys.Count;
            } catch (DivideByZeroException) {
                IKey.WIDTH = 0;
            }
        }
示例#18
0
 internal void RaiseOnRemove(string sender = null, XBMCRPC.Playlist.OnRemove_data data = null)
 {
     if (OnRemove != null)
     {
         OnRemove.BeginInvoke(sender, data, null, null);
     }
 }
示例#19
0
        private void RemoveFunction_Click(object sender, RoutedEventArgs e)
        {
            var g = graph.TopGraph();

            if (MessageBox.Show("Remove Function: " + graph.Name + "?", "", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                if (g != null)
                {
                    if (isPromotedFunc)
                    {
                        if (!string.IsNullOrEmpty(nodeId) && !string.IsNullOrEmpty(param))
                        {
                            g.RemoveParameterValue(nodeId, param);

                            if (OnRemove != null)
                            {
                                OnRemove.Invoke(this);
                            }
                        }
                    }
                    else
                    {
                        if (g.RemoveCustomFunction(graph))
                        {
                            if (OnRemove != null)
                            {
                                OnRemove.Invoke(this);
                            }
                        }
                    }
                }
            }
        }
示例#20
0
        private void RegisterCallbacks()
        {
            duplicateButton.onClick.AddListener(() => OnDuplicate?.Invoke());
            addButton.onClick.AddListener(() => OnAdd?.Invoke());
            removeButton.onClick.AddListener(() => OnRemove?.Invoke());
            moveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke());
            moveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke());

            RegisterSegmentedControlCallbacks(eventTypeSelect);
            RegisterSegmentedControlCallbacks(qualRankSelect);
            RegisterSegmentedControlCallbacks(inLimitSelect);
            RegisterSegmentedControlCallbacks(preQualLimitSelect);
            RegisterSegmentedControlCallbacks(preQualRankSelect);
            RegisterSegmentedControlCallbacks(ordRankSelect);
            RegisterSegmentedControlCallbacks(hillSurfaceSelect);

            presetsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            hillsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            hillsDropdown.onValueChanged.AddListener(arg => ShowInfo());
            inLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke());
            qualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            preQualLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke());
            preQualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            ordRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());

            hillsSearch.OnValueChanged += data => { OnCurrentEventChanged?.Invoke(); };
        }
示例#21
0
 protected void PermitMove(OnRemove pEvent)
 {
     _onUI           = false;
     _isHolding      = false;
     moveHold        = false;
     _counterEmitter = 0;
 }
示例#22
0
 private void fireOnRemove(TKey key)
 {
     if (OnRemove != null)
     {
         OnRemove.Invoke(key);
     }
 }
示例#23
0
 /// <summary>
 /// Removes a child from this container
 /// </summary>
 /// <param name="container">Container to remove</param>
 public virtual void RemoveChild(BaseContainer container)
 {
     container.ParentContainer = null;
     Children.Remove(container);
     Controls.Remove(container);
     OnRemove?.Invoke(container);
 }
        new public void Clear()
        {
            Dictionary <TKey, TValue> remove = new Dictionary <TKey, TValue>(this);

            base.Clear();
            OnRemove?.Invoke(this, remove);
            OnDictionaryChanged?.Invoke(this);
        }
示例#25
0
 public void Remove(RuntimeItem <T> item)
 {
     if (Items.Contains(item))
     {
         Items.Remove(item);
         OnRemove?.Invoke(item);
     }
 }
示例#26
0
 private void Min_Click(object sender, EventArgs e)
 {
     if (Count > 0)
     {
         Count--;
         OnRemove?.Invoke(this, EventArgs.Empty);
     }
 }
示例#27
0
 private void Start()
 {
     AddButton.onClick.AddListener(() => OnAdd?.Invoke(Index));
     RemoveButton.onClick.AddListener(() => OnRemove?.Invoke(Index));
     MoveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke(Index));
     MoveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke(Index));
     TypeDropdown.onValueChanged.AddListener(FireTypeChangedEvent);
 }
示例#28
0
        public void RemoveAt(int index)
        {
            T item = list[index];

            list.RemoveAt(index);
            OnRemove.Invoke(item);
            OnChange.Invoke(default(T));
        }
示例#29
0
 public void Dispose()
 {
     OnRemove?.Invoke(this, typeof(T));
     OnRemove      = null;
     _storage      = null;
     _creator      = null;
     _createMethod = null;
 }
示例#30
0
        public new void RemoveAt(Int32 index)
        {
            T item = this[index];

            base.RemoveAt(index);
            OnRemove?.Invoke(item);
            ItemsChanged?.Invoke();
        }