public bool ConnectToSW(object thisSw, int cookie) { SwApp = (SldWorks)thisSw; Active = this; SwApp.SetAddinCallbackInfo2(0, this, cookie); CommandManager = SwApp.GetCommandManager(cookie); _Bmp = new BitmapHandler(); AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; var d0 = Disposable.Create(() => AppDomain.CurrentDomain.AssemblyResolve -= ResolveAssembly); var d1 = OpenGlRenderer.Setup((SldWorks)SwApp); var d2 = new CompositeDisposable(Setup()); _Disposable = new CompositeDisposable(_Bmp, d0, d1, d2); return(true); }