private void connectToSmartboard() { try { Sbsdk = new SBSDKBaseClass2(); } catch (Exception e) { MessageBox.Show("A SMARTboard cannot be found. Please check your connection to the SMARTboard."); return; //Logger.log("Exception in Main: " + e.Message); } if (Sbsdk != null) { SbsdkEvents = (_ISBSDKBaseClass2Events_Event)Sbsdk; } if (SbsdkEvents != null) { SbsdkEvents.OnEraser += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnEraserEventHandler(this.OnEraser); SbsdkEvents.OnNoTool += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnNoToolEventHandler(this.OnNoTool); SbsdkEvents.OnPen += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnPenEventHandler(this.OnPen); SbsdkEvents.OnBoardStatusChange += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnBoardStatusChangeEventHandler(this.OnBoardStatusChange); } if (Sbsdk != null) { Sbsdk.SBSDKAttachWithMsgWnd(mainMeTLWindowPtr.ToInt32(), false, mainMeTLWindowPtr.ToInt32()); Sbsdk.SBSDKSetSendMouseEvents(mainMeTLWindowPtr.ToInt32(), _SBCSDK_MOUSE_EVENT_FLAG.SBCME_ALWAYS, -1); } isConnected = true; SMARTboardConsole("Connected to SMARTboard"); }
private void connectToSmartboard(object _unused) { try { Main_Loaded(); Sbsdk = new SBSDKBaseClass2(); } catch (Exception e) { Logger.Log("SmartboardConnector::connectToSmartboard Exception: " + e.Message); return; } if (Sbsdk != null) { SbsdkEvents = (_ISBSDKBaseClass2Events_Event)Sbsdk; } if (SbsdkEvents != null) { SbsdkEvents.OnEraser += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnEraserEventHandler(this.OnEraser); SbsdkEvents.OnNoTool += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnNoToolEventHandler(this.OnNoTool); SbsdkEvents.OnPen += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnPenEventHandler(this.OnPen); SbsdkEvents.OnBoardStatusChange += new SBSDKComWrapperLib._ISBSDKBaseClass2Events_OnBoardStatusChangeEventHandler(this.OnBoardStatusChange); } if (Sbsdk != null) { Sbsdk.SBSDKAttachWithMsgWnd(mainMeTLWindowPtr.ToInt32(), false, mainMeTLWindowPtr.ToInt32()); Sbsdk.SBSDKSetSendMouseEvents(mainMeTLWindowPtr.ToInt32(), _SBCSDK_MOUSE_EVENT_FLAG.SBCME_ALWAYS, -1); } isConnected = true; Commands.RequerySuggested(smartboardCommands); SMARTboardConsole("Connected to SMARTboard"); }