コード例 #1
0
 void IRemovableObject.RemoveObject()
 {
     if ((source != null) & (target != null))
     {
         source.Remove(target);
         source = null;
         target = null;
     }
 }
コード例 #2
0
        void SetEvents()
        {
            Prepare();
            if (!(collection is IAddRemove))
            {
                return;
            }
            act = (object o) => { Prepare(); };
            IAddRemove r = collection as IAddRemove;

            r.AddAction    += act;
            r.RemoveAction += act;
        }
コード例 #3
0
        void IDisposable.Dispose()
        {
            if (isDisposed)
            {
                return;
            }
            if (!(collection is IAddRemove))
            {
                return;
            }
            IAddRemove r = collection as IAddRemove;

            r.AddAction    -= act;
            r.RemoveAction -= act;
            isDisposed      = true;
        }