예제 #1
0
 private void Pin_ValueChanged(object sender, GpioPinValueChangedEventArgs e)
 {
     if (e.Edge == GpioPinEdge.RisingEdge)
     {
         Touched?.Invoke();
     }
     else
     {
         Untouched?.Invoke();
     }
 }
예제 #2
0
        protected void handleFile(FileName sourceFile, FolderName currentTargetFolder)
        {
            var targetFile = currentTargetFolder + sourceFile;

            if (copyIfNeeded(sourceFile, targetFile).If(out var file, out var _exception))
            {
                Success?.Invoke(this, new FileArgs(file, targetFile, $"{sourceFile} {(move ? "moved" : "copied")} to {targetFile}"));
            }
            else if (_exception.If(out var exception))
            {
                Failure?.Invoke(this, new FailedFileArgs(sourceFile, targetFile, exception));
            }
            else
            {
                Untouched?.Invoke(this, new FileArgs(sourceFile, targetFile, $"{sourceFile} not touched"));
            }
        }
예제 #3
0
 protected void EmitUntouched()
 {
     Untouched?.Invoke(this, EventArgs.Empty);
 }