private void PPRRibbon_Load(object sender, RibbonUIEventArgs e) { #if !DEBUG this.buttonCopyCodeToClipboard.Visible = false; #endif this.addInInstance = PPRAddIn.GetInstance(); PPRServer server = this.addInInstance.GetServer(); if (server != null) { server.Started += server_Started; server.Stopped += server_Stopped; server.ClientStatus += server_ClientStatus; } this.server_Stopped(this, EventArgs.Empty); }
/// <summary> /// Called when the AddIn was loaded. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">Event arguments.</param> private void ThisAddIn_Startup(object sender, System.EventArgs e) { // Add a handler for when we crash (hopefully: never) AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // save our instance if ( PPRAddIn.instance == null ) PPRAddIn.instance = this; // create a new server this.server = new PPRServer(); // listen to requests (commands) issued by the connected peer this.server.ClientRequest += server_ClientRequest; // listen to presentation changes (inside PowerPoint) Application.SlideShowBegin += Application_SlideShowBegin; Application.SlideShowEnd += Application_SlideShowEnd; Application.SlideShowNextSlide += Application_SlideShowNextSlide; }