예제 #1
0
        private void PopFrom(Layer RenderGroup)
        {
            if (!IsShowed)
            {
                throw new Exception("This object is not showed yet");
            }
            if (Removing != null)
            {
                new Thread(() =>
                {
                    Removing.Invoke(this, null);

                    RenderGroup.RenderGroup.Remove(this);
                    IsShowed = false;

                    Removed?.Invoke(this, null);
                })
                {
                    IsBackground = true
                }.Start();
                return;
            }

            RenderGroup.RenderGroup.Remove(this);
            IsShowed = false;
            Removed?.Invoke(this, null);
            _father = null;
        }
예제 #2
0
        public bool Remove(TKey key)
        {
            if (!ContainsKey(key))
            {
                return(false);
            }
            Removing.Execute(key, this[key]);
            bool result = m_data.Remove(key);

            Modified.Execute();
            return(result);
        }
예제 #3
0
 public bool Remove(T item)
 {
     if (m_base.Contains(item))
     {
         Removing.Execute(item);
         bool result = m_base.Remove(item);
         Modified.Execute();
         return(result);
     }
     else
     {
         return(false);
     }
 }
예제 #4
0
 public T this[int index]
 {
     get
     {
         return(m_base[index]);
     }
     set
     {
         Removing.Execute(m_base[index]);
         Inserting.Execute(value);
         m_base[index] = value;
         Inserted.Execute(value);
         Modified.Execute();
     }
 }
예제 #5
0
 public TValue this[TKey key]
 {
     get
     {
         return(m_data[key]);
     }
     set
     {
         if (ContainsKey(key))
         {
             Removing.Execute(key, this[key]);
             m_data.Remove(key);
         }
         Inserting.Execute(key, value);
         m_data[key] = value;
         Modified.Execute();
     }
 }
예제 #6
0
 /// <summary>
 /// Event Handler for the Removing event
 /// </summary>
 /// <param name="e">The ListChangedEventArgs</param>
 protected void OnRemoving(ListChangedEventArgs e)
 {
     Removing?.Invoke(this, e);
 }
예제 #7
0
 public Administrator()
 {
     addBehaviour    = new Adding();
     editBehaviour   = new Editing();
     removeBehaviour = new Removing();
 }
예제 #8
0
 /* ----------------------------------------------------------------- */
 ///
 /// OnRemoving
 ///
 /// <summary>
 /// Removing イベントを発生させます。
 /// </summary>
 ///
 /* ----------------------------------------------------------------- */
 protected virtual void OnRemoving(ValueCancelEventArgs <int[]> e)
 => Removing?.Invoke(this, e);
 /// <summary>
 /// Raises the Removing event.
 /// </summary>
 /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param>
 protected virtual void OnRemoving(TypedCollectionEventArgs <T> e)
 {
     Removing?.Invoke(this, e);
 }
예제 #10
0
 private void OnRemoving(T item)
 {
     // Note: This event cannot be blocked!
     Removing?.Invoke(item);
 }
예제 #11
0
 public void Subscribe(Adding addMethod, Removing removeMethod)
 {
     AddEntityEvent    += addMethod;
     RemoveEntityEvent += removeMethod;
 }
예제 #12
0
 protected virtual void OnRemoving(EventArgs ea) => Removing?.Invoke(this, ea);
예제 #13
0
 private void buttonRemoveCondition_Click(object sender, EventArgs e)
 {
     Removing?.Invoke(sender, this);
 }
예제 #14
0
        private bool _RemoveCache(string name, bool immediately = false, bool force = false)
        {
            if (name == null || name == "")
            {
                return(false);
            }
            if (Config.Detail_Debug_Log())
            {
                Debug.LogWarning("begin remove cache->" + name + "^" + immediately + "^" + force);
            }
            Request request;

            if (cache.TryGetValue(name, out request))
            {
                try
                {
                    if (!force)
                    {
                        request.referenceNum--;

                        if (Config.Detail_Debug_Log())
                        {
                            Debug.LogWarning("remove cache reference num->" + request.referenceNum);
                        }
                        if (request.referenceNum <= 0)
                        {
                            if (!immediately)
                            {
                                Removing rm = new Removing();
                                rm.request = request;
                                rm.name    = name;
                                needUnLoad.Add(rm);
                            }
                            else
                            {
                                UnloadRequest(name, request);
                            }
                        }
                    }
                    else
                    {
                        if (!immediately && (request.asset == null && request.raf == null))
                        {
                            return(false);
                        }
                        UnloadRequest(name, request);
                    }
                }
                catch (System.Exception e)
                {
                    //#if UNITY_EDITOR
                    Debugger.LogError("remove load cache failed->" + e.ToString());
                    //#endif
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #15
0
 /// <summary>
 /// Ensures this <see cref="Component"/> will be removed by the engine after Update returns.
 /// </summary>
 protected virtual void OnRemove()
 {
     IsRemoved = true;
     Removing?.Invoke(this);
 }
예제 #16
0
 private void RaiseRemoving()
 {
     Removing?.Invoke(this, EventArgs.Empty);
 }
예제 #17
0
 protected void FireRemoving(T item) => Removing?.Invoke(item);
예제 #18
0
 /// <summary>
 /// Raises the Removing event.
 /// </summary>
 /// <param name="e">A NavButtonSpecEventArgs instance containing event data.</param>
 protected void OnRemoving(ButtonSpecEventArgs e)
 {
     e.ButtonSpec.Owner = null;
     Removing?.Invoke(this, e);
 }
예제 #19
0
 public void RemoveAt(int index)
 {
     Removing.Execute(this[index]);
     m_base.RemoveAt(index);
     Modified.Execute();
 }