public void OnConnection(object Application, ext_ConnectMode ConnectMode, object AddInInst, ref Array custom) { try { _vbe = RootComWrapperFactory.GetVbeWrapper(Application); _addin = RootComWrapperFactory.GetAddInWrapper(AddInInst); _addin.Object = this; _vbeNativeApi = new VbeNativeApiAccessor(); _beepInterceptor = new BeepInterceptor(_vbeNativeApi); VbeProvider.Initialize(_vbe, _vbeNativeApi, _beepInterceptor); VbeNativeServices.HookEvents(_vbe); SetAddInObject(); switch (ConnectMode) { case ext_ConnectMode.ext_cm_Startup: // normal execution path - don't initialize just yet, wait for OnStartupComplete to be called by the host. break; case ext_ConnectMode.ext_cm_AfterStartup: _isBeginShutdownExecuted = false; //When we reconnect after having been unloaded, the variable might no longer have its initial value. InitializeAddIn(); break; } } catch (Exception e) { Console.WriteLine(e); } }
internal static void Initialize(IVBE vbe, IVbeNativeApi vbeNativeApi, IBeepInterceptor beepInterceptor) { Vbe = vbe; VbeNativeApi = vbeNativeApi; BeepInterceptor = beepInterceptor; }
public Beep(IBeepInterceptor interceptor) { _interceptor = interceptor; _interceptor.Beep += BeepCallback; }
public ShowQuickInfoCommand(IVBE vbe, IVbeEvents vbeEvents, IBeepInterceptor beepInterceptor) : base(vbeEvents) { _vbe = vbe; _beepInterceptor = beepInterceptor; AddToCanExecuteEvaluation(SpecialEvaluateCanExecute); }