public void Dispose()
 {
     _findFirstFile           = null;
     _createDirectoryDelegate = null;
     _createFileDelegate      = null;
     _moveFileDelegate        = null;
     _removeDirectoryDelegate = null;
     _readFileDelegate        = null;
     _deleteFileDelegate      = null;
 }
Exemplo n.º 2
0
 public MarkdownContext(
     Func <string, string> getToken = null,
     LogActionDelegate logWarning   = null,
     LogActionDelegate logError     = null,
     ReadFileDelegate readFile      = null)
 {
     _getToken  = getToken ?? (_ => null);
     ReadFile   = readFile ?? ReadFileDefault;
     LogWarning = logWarning ?? ((a, b, c, d) => { });
     LogError   = logError ?? ((a, b, c, d) => { });
 }
Exemplo n.º 3
0
 static NativeFile()
 {
     // Initialize all the DllImports at once, since we are going to use all of them anyway.
     ReadFile                     = (ReadFileDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.ReadFile()), typeof(ReadFileDelegate));
     FlushFileBuffers             = (FlushFileBuffersDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.FlushFileBuffers()), typeof(FlushFileBuffersDelegate));
     WriteFile                    = (WriteFileDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.WriteFile()), typeof(WriteFileDelegate));
     SetFilePointerEx             = (SetFilePointerExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.SetFilePointerEx()), typeof(SetFilePointerExDelegate));
     SetEndOfFile                 = (SetEndOfFileDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.SetEndOfFile()), typeof(SetEndOfFileDelegate));
     Create                       = (CreateDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.CreateFile2()), typeof(CreateDelegate));
     GetFileInformationByHandleEx = (GetFileInformationByHandleExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.GetFileInformationByHandleEx()), typeof(GetFileInformationByHandleExDelegate));
     GetFileAttributesEx          = (GetFileAttributesExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.GetFileAttributesExW()), typeof(GetFileAttributesExDelegate));
 }
Exemplo n.º 4
0
        public MarkdownContext(
            IReadOnlyDictionary <string, string> tokens = null,
            LogActionDelegate logWarning = null,
            LogActionDelegate logError   = null,
            ReadFileDelegate readFile    = null,
            GetLinkDelegate getLink      = null)
        {
            Tokens   = tokens ?? ImmutableDictionary <string, string> .Empty;
            ReadFile = readFile ?? ReadFileDefault;
            GetLink  = getLink ?? ((path, relativeTo) => path);

            LogWarning = logWarning;
            LogError   = logError;
        }
Exemplo n.º 5
0
 public MarkdownContext(
     Func <string, string> getToken  = null,
     LogActionDelegate logInfo       = null,
     LogActionDelegate logSuggestion = null,
     LogActionDelegate logWarning    = null,
     LogActionDelegate logError      = null,
     ReadFileDelegate readFile       = null,
     GetLinkDelegate getLink         = null)
 {
     _getToken     = getToken ?? (_ => null);
     ReadFile      = readFile ?? ((a, b) => (a, a));
     GetLink       = getLink ?? ((a, b) => a);
     LogInfo       = logInfo ?? ((a, b, c, d) => { });
     LogSuggestion = logSuggestion ?? ((a, b, c, d) => { });
     LogWarning    = logWarning ?? ((a, b, c, d) => { });
     LogError      = logError ?? ((a, b, c, d) => { });
 }
Exemplo n.º 6
0
 protected DokanDefaultImplementation(CreateFileDelegate onCreateFile           = null,
                                      OpenDirectoryDelegate onOpenDirectory     = null,
                                      CreateDirectoryDelegate onCreateDirectory = null,
                                      CleanupDelegate onCleanup     = null,
                                      CloseFileDelegate onCloseFile = null,
                                      ReadFileDelegate onReadFile   = null,
                                      WriteFileDelegate onWriteFile = null,
                                      FlushFileBuffersDelegate onFlushFileBuffers     = null,
                                      GetFileInformationDelegate onGetFileInformation = null,
                                      FindFilesDelegate onFindFiles = null,
                                      SetFileAttributesDelegate onSetFileAttributes = null,
                                      SetFileTimeDelegate onSetFileTime             = null,
                                      DeleteFileDelegate onDeleteFile           = null,
                                      DeleteDirectoryDelegate onDeleteDirectory = null,
                                      MoveFileDelegate onMoveFile                   = null,
                                      SetEndOfFileDelegate onSetEndOfFile           = null,
                                      SetAllocationSizeDelegate onSetAllocationSize = null,
                                      LockFileDelegate onLockFile                   = null,
                                      UnlockFileDelegate onUnlockFile               = null,
                                      GetDiskFreeSpaceDelegate onGetDiskFreeSpace   = null,
                                      UnmountDelegate onUnmount = null)
 {
     OnCreateFile         = onCreateFile;
     OnOpenDirectory      = onOpenDirectory;
     OnCreateDirectory    = onCreateDirectory;
     OnCleanup            = onCleanup;
     OnCloseFile          = onCloseFile;
     OnReadFile           = onReadFile;
     OnWriteFile          = onWriteFile;
     OnFlushFileBuffers   = onFlushFileBuffers;
     OnGetFileInformation = onGetFileInformation;
     OnFindFiles          = onFindFiles;
     OnSetFileAttributes  = onSetFileAttributes;
     OnSetFileTime        = onSetFileTime;
     OnDeleteFile         = onDeleteFile;
     OnDeleteDirectory    = onDeleteDirectory;
     OnMoveFile           = onMoveFile;
     OnSetEndOfFile       = onSetEndOfFile;
     OnSetAllocationSize  = onSetAllocationSize;
     OnLockFile           = onLockFile;
     OnUnlockFile         = onUnlockFile;
     OnGetDiskFreeSpace   = onGetDiskFreeSpace;
     OnUnmount            = onUnmount;
 }
 private void InitializeDelegates()
 {
     _createFileDelegate                 = new CreateFileADelegate(CreateFileHook);
     _createDirectoryDelegate            = new CreateDirectoryDelegate(CreateDirectoryHook);
     _deleteFileDelegate                 = new DeleteFileDelegate(DeleteFileHook);
     _removeDirectoryDelegate            = new RemoveDirectoryDelegate(RemoveDirectoryHook);
     _moveFileDelegate                   = new MoveFileDelegate(MoveFileHook);
     _readFileDelegate                   = new ReadFileDelegate(ReadFileHook);
     _closeHandleDelegate                = new CloseHandleDelegate(CloseHandleHook);
     _getFileAttributesDelegate          = new GetFileAttributesDelegate(GetFileAttributesHook);
     _getFileTypeDelegate                = new GetFileTypeDelegate(GetFileTypeHook);
     _setFilePointerDelegate             = new SetFilePointerDelegate(SetFilePointerHook);
     _getFileInformationByHandleDelegate = new GetFileInformationByHandleDelegate(GetFileInformationByHandleHook);
     _setEndOfFileDelegate               = new SetEndOfFileDelegate(SetEndOfFileHook);
     _findFirstFile = new FindFirstFile(FindFirstFileHook);
     _findNextFile  = new FindNextFile(FindNextFileHook);
     _findClose     = new FindClose(FindCloseHook);
     _tioPathAdd    = new TioPathAdd(TioPathAddHook);
 }
 public void setReadFunction(ReadFileDelegate newFunction)
 {
     this.readFileCurrentFunction = newFunction;
 }
Exemplo n.º 9
0
 static NativeFile()
 {
     // Initialize all the DllImports at once, since we are going to use all of them anyway.
     ReadFile = (ReadFileDelegate) Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.ReadFile()), typeof (ReadFileDelegate));
     FlushFileBuffers = (FlushFileBuffersDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.FlushFileBuffers()), typeof(FlushFileBuffersDelegate));
     WriteFile = (WriteFileDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.WriteFile()), typeof(WriteFileDelegate));
     SetFilePointerEx = (SetFilePointerExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.SetFilePointerEx()), typeof(SetFilePointerExDelegate));
     SetEndOfFile = (SetEndOfFileDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.SetEndOfFile()), typeof(SetEndOfFileDelegate));
     Create = (CreateDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.CreateFile2()), typeof(CreateDelegate));
     GetFileInformationByHandleEx = (GetFileInformationByHandleExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.GetFileInformationByHandleEx()), typeof(GetFileInformationByHandleExDelegate));
     GetFileAttributesEx = (GetFileAttributesExDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(SharpDX.WP8.Interop.GetFileAttributesExW()), typeof(GetFileAttributesExDelegate));
 }