//Function GetMaxInternalBuffersize() As Integer // 'NOTE: Only increase FSW InternalBuffersize after evaluation other options: // ' http://msdn.microsoft.com/en-us/library/ded0dc5s.aspx // ' http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx // Dim maxInternalBufferSize64BitOS = ByteSize.ByteSize.FromKiloBytes(16 * 4) // Dim maxInternalBufferSize32BitOS = ByteSize.ByteSize.FromKiloBytes(2 * 4) // If Environment.Is64BitOperatingSystem Then // Return maxInternalBufferSize64BitOS.Bytes // Else // Return maxInternalBufferSize32BitOS.Bytes // End If //End Function private bool ExceptionWasHandledByCaller(Exception ex) { //Allow consumer to handle error if (_onErrorHandler != null) { FileWatcherErrorEventArgs e = new FileWatcherErrorEventArgs(ex); InvokeHandler(_onErrorHandler, e); return(e.Handled); } else { return(false); } }
private void InvokeHandler(EventHandler <FileWatcherErrorEventArgs> eventHandler, FileWatcherErrorEventArgs e) { if (eventHandler != null) { if (SynchronizingObject != null && this.SynchronizingObject.InvokeRequired) { SynchronizingObject.BeginInvoke(eventHandler, new object[] { this, e }); } else { eventHandler(this, e); } } }