static Native() { //RuntimeCil.Generate(typeof(MemoryMapped).Assembly); Create = Marshal.GetDelegateForFunctionPointer <CreateDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Create")); CreateAndOpen = Marshal.GetDelegateForFunctionPointer <CreateAndOpenDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "CreateAndOpen")); Destory = Marshal.GetDelegateForFunctionPointer <DestoryDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Destory")); Open = Marshal.GetDelegateForFunctionPointer <OpenDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Open")); Close = Marshal.GetDelegateForFunctionPointer <CloseDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Close")); At = Marshal.GetDelegateForFunctionPointer <AtDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "At")); GetData = Marshal.GetDelegateForFunctionPointer <GetDataDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "GetData")); IsValid = Marshal.GetDelegateForFunctionPointer <IsValidDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "IsValid")); Size = Marshal.GetDelegateForFunctionPointer <SizeDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Size")); MappedSize = Marshal.GetDelegateForFunctionPointer <MappedSizeDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "MappedSize")); Remap = Marshal.GetDelegateForFunctionPointer <RemapDelegate>(PlatformApi.NativeLibrary.GetExport(KokkosLibrary.ModuleHandle, "Remap")); }
/// <summary> /// CONSTRUCTOR for DisplayView Class /// </summary> /// <param name="pFlipH"> StrategyDelegate passed in, flips horizontally</param> /// <param name="pExecute"></param> /// <param name="pResize"></param> /// <param name="pFlipV"> StrategyDelegate passed in, flips vertically </param> /// <param name="pRCW"> StrategyDelegate passed in, rotates clockwise </param> /// <param name="pRACW"> StrategyDelegate passed in, rotates anti clockwise </param> /// /// <param name="pRACW"> StrategyDelegate passed in, saves image </param> public DisplayView(StrategyDelegate pFlipH, ExecuteDelegate pExecute, SizeDelegate pResize, StrategyDelegate pFlipV, StrategyDelegate pRCW, StrategyDelegate pRACW, StrategyDelegate pSave) { InitializeComponent(); // SET _flipH delegate to StrategyDelegate passed in (pFlipH) _flipH = pFlipH; // SET ExecuteDelegate to ExecuteDelegate passed in _execute = pExecute; // SET ResizeDelegate to ResizeDelegate passed in _resize = pResize; // SET _flipV delegate to StrategyDelegate passed in (pFlipV) _flipV = pFlipV; // SET _rotateCW delegate to StrategyDelegate passed in (pRCW) _rotateCW = pRCW; // SET _rotateACW delegate to StrategyDelegate passed in (pRACW) _rotateACW = pRACW; // SET _save StrategyDelegat to StrategyDelegate passed in (pSave) _save = pSave; // SET _minSize as a new Size, the width being the far most right button position (save button) // + its width and some extra width, same with height but y position and the save buttons height _minSize = new Size(SaveBtn.Location.X + SaveBtn.Width + 20, SaveBtn.Location.Y + SaveBtn.Height + 20); // SET the minimum size property of the DisplayView to _minSize variable this.MinimumSize = _minSize; // SET this windows visibility to true upon creation this.Visible = true; }
/// <summary> /// CONSTRUCTOR for ResizeCommand /// </summary> /// <param name="pAction"> delegate passed in</param> /// <param name="pSize"> size data passed in</param> public ResizeCommand(SizeDelegate pAction, Size pSize) { // SET _action to SizeDelegate passed in _action = pAction; // SET _sie to Size variable passed in _size = pSize; }
public int ExecuteSizeDelegate(SizeDelegate del) { lastDel = del; Execute(); return mySizeFromDel; }
/// <summary> /// Sets the delegate. /// </summary> /// <param name="createMemoryMappedFile">Creates a memory mapped file delegate.</param> /// <param name="createMemoryMappedSharedFile">Creates a shared memory mapped file delegate.</param> /// <param name="getSizeDelegate">Delegate to calculate the size in-memory of the given type.</param> public static void SetDelegates(NativeMemoryMappedFileCreate createMemoryMappedFile, NativeMemoryMappedFileSharedCreate createMemoryMappedSharedFile, SizeDelegate getSizeDelegate) { _nativeMemoryMappedFileDelegate = createMemoryMappedFile; _nativeMemoryMappedFileSharedDelegate = createMemoryMappedSharedFile; _getSizeDelegate = getSizeDelegate; }