示例#1
0
        public static void RegisterCallback(int index, IntPtr function)
        {
            switch (index)
            {
            case CREATE_WINDOW_CALLBACK:
                createWindowCallback = (IdeCreateWindow)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeCreateWindow));
                break;

            case SET_TEXT_CALLBACK:
                setTextCallback = (IdeSetText)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeSetText));
                break;
            }
        }
示例#2
0
        public static void RegisterCallback(int index, IntPtr function)
        {
            switch (index)
            {
            case IDE_GET_PREF_AS_STRING:
                getPrefCallback = (IdeGetPrefAsString)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetPrefAsString));
                break;

            case IDE_GET_PERSONAL_PREF_SETS:
                getPrefSetsCallback = (IdeGetPersonalPrefSets)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetPersonalPrefSets));
                break;

            case IDE_GET_PREF_AS_BOOL:
                getBoolPrefCallback = (IdeGetPrefAsBool)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetPrefAsBool));
                break;

            case IDE_EXECUTE_TEMPLATE:
                execTemplateCallback = (IdeExecuteTemplate)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeExecuteTemplate));
                break;

            case IDE_GET_TEXT:
                getTextCallback = (IdeGetText)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetText));
                break;

            case IDE_SET_TEXT:
                setTextCallback = (IdeSetText)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeSetText));
                break;

            case IDE_GET_CURSOR_X:
                getCursorXCallback = (IdeGetCursorX)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetCursorX));
                break;

            case IDE_GET_CURSOR_Y:
                getCursorYCallback = (IdeGetCursorY)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetCursorY));
                break;

            case IDE_SET_CURSOR:
                setCursorCallback = (IdeSetCursor)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeSetCursor));
                break;

            case IDE_GET_READ_ONLY:
                getReadOnlyCallback = (IdeGetReadOnly)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetReadOnly));
                break;

            case IDE_GET_GENERAL_PREF:
                getGeneralPrefCallback = (IdeGetGeneralPref)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetGeneralPref));
                break;
            }
        }
        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;
            }
        }