Ejemplo n.º 1
0
        public void UnregisterEffect(ViewNode parent, ViewNode child)
        {
            I instance = (I)(child.Instance as I);

            if ((E)(child.Instance as E) != null)
            {
                instance = (I)(parent.Instance as I);
            }
            if (instance == null)
            {
                return;
            }
            for (int i = this.effectRegistrar.Count - 1; i >= 0; i--)
            {
                EffectManager <I, E> .EffectEntry <I, E> item = this.effectRegistrar[i];
                I i1 = WeakReferenceHelper.Unwrap <I>(item.instance);
                if (i1 == null)
                {
                    this.effectRegistrar.RemoveAt(i);
                }
                else if (object.Equals(i1, instance))
                {
                    this.effectRegistrar.RemoveAt(i);
                }
            }
        }
Ejemplo n.º 2
0
 private void ChangeEffectEnableState()
 {
     this.changingEffectState = true;
     for (int i = this.effectRegistrar.Count - 1; i >= 0; i--)
     {
         EffectManager <I, E> .EffectEntry <I, E> item = this.effectRegistrar[i];
         I i1 = WeakReferenceHelper.Unwrap <I>(item.instance);
         if (i1 != null)
         {
             this.applyEffectMethod(i1);
         }
         else
         {
             this.effectRegistrar.RemoveAt(i);
         }
     }
     this.changingEffectState = false;
 }