public static void RegisterCallback(int index, IntPtr function) { switch (index) { case CallbackIndexes.SYS_VERSION: sysVersion = Marshal.GetDelegateForFunctionPointer <SysVersion>(function); break; case CallbackIndexes.IDE_CREATE_WINDOW: createWindowCallback = Marshal.GetDelegateForFunctionPointer <IdeCreateWindow>(function); break; case CallbackIndexes.IDE_SET_TEXT: setTextCallback = Marshal.GetDelegateForFunctionPointer <IdeSetText>(function); break; case CallbackIndexes.IDE_GET_CONNECTION_INFO: getConnectionInfo = Marshal.GetDelegateForFunctionPointer <IdeGetConnectionInfo>(function); break; case CallbackIndexes.IDE_GET_WINDOW_TYPE: getWindowType = Marshal.GetDelegateForFunctionPointer <IdeGetWindowType>(function); break; case CallbackIndexes.IDE_SET_STATUS_MESSAGE: setStatusMessage = Marshal.GetDelegateForFunctionPointer <IdeSetStatusMessage>(function); break; case CallbackIndexes.IDE_FILENAME: func_IdeFilename = Marshal.GetDelegateForFunctionPointer <IdeFilename>(function); break; case CallbackIndexes.IDE_GET_WINDOW_OBJECT: ideGetWindowObject = Marshal.GetDelegateForFunctionPointer <IdeGetWindowObject>(function); break; case CallbackIndexes.IDE_GET_CURSOR_X: ideGetCursorColumn = Marshal.GetDelegateForFunctionPointer <IdeGetCursorX>(function); break; case CallbackIndexes.IDE_GET_CURSOR_Y: ideGetCursorLine = Marshal.GetDelegateForFunctionPointer <IdeGetCursorY>(function); break; } }
public static void RegisterCallback(int index, IntPtr function) { switch (index) { case CREATE_WINDOW_CALLBACK: createWindowCallback = Marshal.GetDelegateForFunctionPointer <IdeCreateWindow>(function); break; case SET_TEXT_CALLBACK: setTextCallback = Marshal.GetDelegateForFunctionPointer <IdeSetText>(function); break; case GET_TEXT_CALLBACK: getTextCallback = Marshal.GetDelegateForFunctionPointer <IdeGetText>(function); break; case FILE_NAME_CALLBACK: fileNameCallback = Marshal.GetDelegateForFunctionPointer <IdeFileName>(function); break; case SAVE_FILE_CALLBACK: saveFileCallback = Marshal.GetDelegateForFunctionPointer <IdeSaveFile>(function); break; case SET_FILE_NAME_CALLBACK: setFilenameCallback = Marshal.GetDelegateForFunctionPointer <IdeSetFilename>(function); break; case GET_FILE_DATA_CALLBACK: getFileDataCallback = Marshal.GetDelegateForFunctionPointer <IdeGetFileData>(function); break; case SHOW_HTML_CALLBACK: showHtmlCallback = Marshal.GetDelegateForFunctionPointer <IdeShowHTML>(function); break; case GET_PREF_STRING_CALLBACK: getPrefAsStringCallback = Marshal.GetDelegateForFunctionPointer <IdeGetPrefAsString>(function); break; case SET_PREF_STRING_CALLBACK: setPrefAsStringCallback = Marshal.GetDelegateForFunctionPointer <IdeSetPrefAsString>(function); break; case SET_PREF_BOOL_CALLBACK: setPrefAsBoolCallback = Marshal.GetDelegateForFunctionPointer <IdeSetPrefAsBool>(function); break; case GET_PREF_BOOL_CALLBACK: getPrefAsBoolCallback = Marshal.GetDelegateForFunctionPointer <IdeGetPrefAsBool>(function); break; case PLUGIN_SETTING_CALLBACK: plugInSettingCallback = Marshal.GetDelegateForFunctionPointer <IdePlugInSetting>(function); break; case CREATE_POPUP_ITEM_CALLBACK: createPopupItemCallback = Marshal.GetDelegateForFunctionPointer <IdeCreatePopupItem>(function); break; case GET_POPUP_OBJECT_CALLBACK: getPopupObjectCallback = Marshal.GetDelegateForFunctionPointer <IdeGetPopupObject>(function); break; case GET_OBJECT_SOURCE_CALLBACK: getObjectSourceCallback = Marshal.GetDelegateForFunctionPointer <IdeGetObjectSource>(function); break; case GET_WINDOW_OBJECT_CALLBACK: getWindowObjectCallback = Marshal.GetDelegateForFunctionPointer <IdeGetWindowObject>(function); break; } }