コード例 #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);
 }