private void Initialize(bool constructing) { if ((this.proxyOptions & ObjectRefProxyOptions.DoNotCreateRef) != ObjectRefProxyOptions.DoNotCreateRef) { IRefTrackedObject innerRef = this.innerRef as IRefTrackedObject; if (!innerRef.IsNullReference<IRefTrackedObject>()) { innerRef.AddRef<IRefTrackedObject>(this); } else if (constructing) { this.AddCleanupRef(this.innerRef); } } if (constructing && ((this.proxyOptions & ObjectRefProxyOptions.DisposeInnerRef) == ObjectRefProxyOptions.DisposeInnerRef)) { this.AddCleanupObject(this.innerRef); } }