/// <summary> /// Override of IDisposable.Dispose to handle implementation details of dispose /// </summary> public void Dispose() { GC.SuppressFinalize(this); if (this._businessLogicModel != null) { try { this._businessLogicModel.Dispose(); } catch (System.Runtime.Remoting.RemotingException) { // This condition is unlikely but possible if the 2nd AppDomain // is torn down independently. There is nothing we can do here, // as it is not a user error. We catch and ignore solely to // prevent the wizard from showing a fatal error the user does // not understand. } this._businessLogicModel = null; } IDisposable disposable = this._clientBuildManager as IDisposable; if (disposable != null) { disposable.Dispose(); } this._clientBuildManager = null; }
/// <summary> /// Initializes a new instance of the <see cref="ContextViewModel"/> class. /// </summary> /// <param name="businessLogicModel">The <see cref="BusinessLogicModel"/> in the other AppDomain with which to communicate.</param> /// <param name="contextData">The shared state with the corresponding <see cref="BusinessLogicContext"/> instance in the other AppDomain.</param> public ContextViewModel(IBusinessLogicModel businessLogicModel, IContextData contextData) { System.Diagnostics.Debug.Assert(businessLogicModel != null, "businessLogicModel cannot be null"); System.Diagnostics.Debug.Assert(contextData != null, "contextData cannot be null"); this._businessLogicModel = businessLogicModel; this._contextData = contextData; }