예제 #1
0
파일: Ensure.cs 프로젝트: Sholtee/injector
 public static void NotDisposed(IDisposableEx obj)
 {
     if (obj.Disposed)
     {
         throw new ObjectDisposedException(null);
     }
 }
예제 #2
0
파일: Ensure.cs 프로젝트: scor7910/ninject1
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Throws an exception if the specified object has been disposed.
 /// </summary>
 /// <param name="obj">The object in question.</param>
 public static void NotDisposed(IDisposableEx obj)
 {
     if (obj.IsDisposed)
     {
         throw new ObjectDisposedException(obj.GetType().Name);
     }
 }
예제 #3
0
            public void Invoke(object sender, TEventArgs e)
            {
                T target = (T)this.targetRef.Target;

                if (target != null)
                {
                    IDisposableEx disposable = target as IDisposableEx;
                    if ((disposable != null) && disposable.IsDisposed)
                    {
                        this.DoUnregister();
                        return;
                    }

                    this.openHandler.Invoke(target, sender, e);
                }
                else
                {
                    this.DoUnregister();
                }
            }
예제 #4
0
		/*----------------------------------------------------------------------------------------*/
		/// <summary>
		/// Throws an exception if the specified object has been disposed.
		/// </summary>
		/// <param name="obj">The object in question.</param>
		public static void NotDisposed(IDisposableEx obj)
		{
			if (obj.IsDisposed)
				throw new ObjectDisposedException(obj.GetType().Name);
		}
예제 #5
0
 public DisposableServiceHavingDisposableDependency(IDisposableEx disposableDep) => DisposableDep = disposableDep;