Esempio n. 1
0
 private void root_ChildRemoved(object sender, ChildEventArgs e)
 {
     if (m_lastRemoveIndex >= 0)
     {
         ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(m_lastRemoveIndex, e.Child, e.Parent));
     }
 }
Esempio n. 2
0
 private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
 {
     if (IsPrototypeItem(e.Child, e.Parent))
     {
         ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, e.Child, e.Parent));
     }
 }
Esempio n. 3
0
 private void root_ChildRemoved(object sender, ChildEventArgs e)
 {
     if (m_lastRemoveIndex >= 0)
     {
         ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(m_lastRemoveIndex, e.Child, e.Parent));
         m_root.As <SceneDocument>().Dirty = true;
     }
 }
Esempio n. 4
0
        private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
        {
            Character character = e.Child.As <Character>();

            if (character != null)
            {
                ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, character));
            }
        }
Esempio n. 5
0
        private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
        {
            Event _event = e.Child.As <Event>();

            if (_event != null)
            {
                ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, _event));
            }
        }
Esempio n. 6
0
        private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
        {
            Resource resource = e.Child.As <Resource>();

            if (resource != null)
            {
                ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, resource));
            }
        }
        /// <summary>
        /// Performs initialization when the adapter's node is set.
        /// Subscribes to events for DomNode tree changes and raises Reloaded event.</summary>
        protected override void OnNodeSet()
        {
            DomNode.AttributeChanged += (sender, e) => ItemChanged.Raise(this, new ItemChangedEventArgs <object>(e.DomNode));
            DomNode.ChildInserted    += (sender, e) => ItemInserted.Raise(this, new ItemInsertedEventArgs <object>(e.Index, e.Child, e.Parent));
            DomNode.ChildRemoved     += (sender, e) => ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, e.Child, e.Parent));

            Reloaded.Raise(this, EventArgs.Empty);
            base.OnNodeSet();
        }
Esempio n. 8
0
        private void DomNodeChildRemoving(object sender, ChildEventArgs e)
        {
            if (!e.Child.Is <SledLuaStateType>())
            {
                return;
            }

            ItemRemoved.Raise(
                this,
                new ItemRemovedEventArgs <object>(e.Index, e.Child.As <SledLuaStateType>()));
        }
Esempio n. 9
0
 private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
 {
     if (!IsHandledType(e.Child))
     {
         return;
     }
     ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(-1, e.Child, e.Parent));
     if (!IsMasterContext)
     {
         MasterContext.DomNode_ChildRemoved(sender, e);
     }
 }
Esempio n. 10
0
        private void RemoveItem(KeyValue item)
        {
            if (item == null)
            {
                return;
            }

            // if (item.Parent != null)
            //     item.Parent.Children.Remove(item);
            // else
            //     m_data.Remove(item);

            ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(-1, item));
        }
Esempio n. 11
0
        protected virtual void OnDomNodeChildRemoving(object sender, ChildEventArgs e)
        {
            if (!e.Child.Is <T>())
            {
                return;
            }

            ItemRemoved.Raise(
                this,
                new ItemRemovedEventArgs <object>(
                    e.Index,
                    e.Child.As <T>(),
                    e.Parent.As <T>()));
        }
Esempio n. 12
0
 public void RemoveItem(object item)
 {
     // not very efficient, but hopefully not a common occurrence
     foreach (KeyValuePair <string, List <object> > pair in m_categories)
     {
         int index = pair.Value.IndexOf(item);
         if (index >= 0)
         {
             pair.Value.RemoveAt(index);
             ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(index, item, pair.Key));
             break;
         }
     }
 }
Esempio n. 13
0
        /// <summary>
        /// Removes an item from the DArray without tracking the free indices.
        /// </summary>
        /// <param name="index">The zero-based index of the item to remove.</param>
        void RemoveAtUntracked(int index)
        {
            var item = _buffer[index];

            _buffer[index]      = default(T);
            _isIndexUsed[index] = false;

            // Notify listeners
            OnItemRemoved(item, index);

            if (ItemRemoved != null)
            {
                ItemRemoved.Raise(this, new DArrayEventArgs <T>(item, index));
            }
        }
Esempio n. 14
0
        private void RemoveItem(DataItem item)
        {
            if (item == null)
            {
                return;
            }

            if (item.Parent != null)
            {
                item.Parent.Children.Remove(item);
            }
            else
            {
                m_data.Remove(item);
            }

            ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(-1, item));
        }
Esempio n. 15
0
        private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
        {
            RemoveNode(e.Child);
            if (IsCircuitItem(e.Child, e.Parent))
            {
                if (e.Child.Is <Wire>())
                {
                    var connection = e.Child.Cast <Wire>();
                    if (connection.InputElement.Is <Group>())
                    {
                        connection.InputElement.Cast <Group>().Dirty = true;
                    }
                    if (connection.OutputElement.Is <Group>())
                    {
                        connection.OutputElement.Cast <Group>().Dirty = true;
                    }
                }


                ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, e.Child, e.Parent));

                var circuitValidator = DomNode.GetRoot().As <CircuitValidator>();
                if (circuitValidator != null)
                {
                    var transactionContext = circuitValidator.ActiveHistoryContext;
                    if (transactionContext != null && transactionContext != this)
                    {
                        if (transactionContext.DomNode.Ancestry.FirstOrDefault(x => x == e.Parent) != null)
                        {
                            if (transactionContext.InTransaction)
                            {
                                transactionContext.AddOperation(new ChildRemovedOperation(e));
#if DEBUG_VERBOSE
                                var parent = transactionContext.DomNode.Ancestry.FirstOrDefault(x => x == e.Parent);
                                Trace.TraceInformation("PARENT GRAPH {0} --  Removed {1}  from parent {2}", CircuitUtil.GetDomNodeName(parent),
                                                       CircuitUtil.GetDomNodeName(e.Child), CircuitUtil.GetDomNodeName(e.Parent));
#endif
                            }
                        }
                    }
                }
            }
        }
Esempio n. 16
0
 private void root_ChildRemoved(object sender, ChildEventArgs e)
 {
     ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(-1, e.Child, e.Parent));
 }
 /// <summary>
 /// Raises the ItemRemoved event</summary>
 /// <param name="e">Event args</param>
 protected virtual void OnItemRemoved(ItemRemovedEventArgs <T> e)
 {
     ItemRemoved.Raise(this, e);
 }
Esempio n. 18
0
 /// <summary>
 /// Raises the ItemRemoved event and performs custom processing</summary>
 /// <param name="e">ItemRemovedEventArgs containing event data</param>
 protected virtual void OnObjectRemoved(ItemRemovedEventArgs <object> e)
 {
     ItemRemoved.Raise(this, e);
 }
Esempio n. 19
0
 void DomNode_ChildRemoved(object sender, ChildEventArgs e)
 {
     ItemRemoved.Raise(this, new ItemRemovedEventArgs <object>(e.Index, e.Child, e.Parent));
 }