Beispiel #1
0
 public AsyncRef(AsyncRecord resource, string debugAnnotation)
 {
     this.resource        = resource;
     this.debugAnnotation = debugAnnotation;
     DiagnosticUI.theDiagnostics.fetchResourceCounter("asyncRef-" + debugAnnotation, -1).crement(1);
     resource.AddRef();
 }
Beispiel #2
0
		public AsyncRef(AsyncRecord resource, string debugAnnotation)
		{
			this.resource = resource;
			this.debugAnnotation = debugAnnotation;
			DiagnosticUI.theDiagnostics.fetchResourceCounter("asyncRef-" + debugAnnotation, -1).crement(1);
			resource.AddRef();
		}
Beispiel #3
0
		public void AddCallback(AsyncRecord.CompleteCallback callback)
		{
			Monitor.Enter(this);
			try
			{
				if (this.present != null)
				{
					AsyncRef asyncRef = new AsyncRef(this, "AsyncRecord.AddCallback");
					callback(asyncRef);
					asyncRef.Dispose();
				}
				else
				{
					this.callbackEvent = (AsyncRecord.CompleteCallback)Delegate.Combine(this.callbackEvent, callback);
				}
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
Beispiel #4
0
		public void AddCallback(AsyncRecord.CompleteCallback callback)
		{
			this.resource.AddCallback(callback);
		}