Skip to content

Commit e781f42

Browse files
authored
Add files via upload
1 parent b7a0f1c commit e781f42

File tree

4 files changed

+80
-32
lines changed

4 files changed

+80
-32
lines changed

SoundBlox/Credits.Designer.cs

Lines changed: 4 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SoundBlox/MainForm.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SoundBlox/MainForm.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,19 @@ private void MainForm_Load(object sender, EventArgs e)
6060
private void transfersounds_Click(object sender, EventArgs e)
6161
{
6262
TransferSounds tfs = new TransferSounds();
63-
tfs.Show();
63+
tfs.ShowDialog();
6464
}
6565

6666
private void button1_Click(object sender, EventArgs e)
6767
{
6868
Converter cv = new Converter();
69-
cv.Show();
69+
cv.ShowDialog();
70+
}
71+
72+
private void button2_Click(object sender, EventArgs e)
73+
{
74+
Credits c = new Credits();
75+
c.ShowDialog();
7076
}
7177
}
7278
}

SoundBlox/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1+
# Instances
2+
A .NET Standard `Process` wrapper with an elegant API, for both asyncronous and syncronous use, providing both Events and support for Tasks with cancellation support
3+
4+
![.NET Core](https://github.com/rosenbjerg/Instances/workflows/CI/badge.svg)
5+
[![codecov.io](https://codecov.io/github/rosenbjerg/agentdeploy/coverage.svg?branch=main)](https://app.codecov.io/gh/rosenbjerg/Instances)
6+
[![GitHub](https://img.shields.io/github/license/rosenbjerg/Instances)](https://github.com/rosenbjerg/Instances/blob/master/LICENSE)
7+
[![Nuget](https://img.shields.io/nuget/v/instances)](https://www.nuget.org/packages/instances/)
8+
[![Nuget](https://img.shields.io/nuget/dt/instances)](https://www.nuget.org/packages/instances/)
9+
![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/nuget/instances)
110

11+
12+
# Usage
13+
There are three ways to use this library, requiring at least 1, 2, or 3 lines of code to use.
14+
15+
### Shortest form, supporting only few options
16+
```c#
17+
var result = await Instance.FinishAsync("dotnet", "build -c Release", cancellationToken);
18+
Console.WriteLine(result.ExitCode);
19+
// or
20+
var result = Instance.Finish("dotnet", "build -c Release");
21+
```
22+
23+
### Short form, supporting more options
24+
```c#
25+
using var instance = Instance.Start("dotnet", "build -c Release");
26+
var result = await instance.WaitForExitAsync(cancellationToken);
27+
// or
28+
using var instance = Instance.Start("dotnet", "build -c Release");
29+
var result = instance.WaitForExit();
30+
```
31+
32+
### Full form, supporting all options
33+
```c#
34+
var processArgument = new ProcessArguments("dotnet", "build -c Release");
35+
processArgument.Exited += (_, exitResult) => Console.WriteLine(exitResult.ExitCode);
36+
processArgument.OutputDataReceived += (_, data) => Console.WriteLine(data);
37+
processArgument.ErrorDataReceived += (_, data) => Console.WriteLine(data);
38+
39+
using var instance = processArgument.Start();
40+
41+
var result = await instance.WaitForExitAsync(cancellationToken);
42+
// or
43+
var result = instance.WaitForExit();
44+
```
45+
46+
47+
## Features
48+
```c#
49+
using var instance = Instance.Start("dotnet", "build -c Release");
50+
51+
// send input to process' standard input
52+
instance.SendInput("Hello World");
53+
54+
// stop the process
55+
instance.Kill();
56+
57+
// access process output
58+
foreach (var line in instance.OutputData)
59+
Console.WriteLine(line);
60+
// and error data easily while the process is running
61+
foreach (var line in instance.ErrorData)
62+
Console.WriteLine(line);
63+
64+
// or wait for the process to exit (with support for cancellation token)
65+
var result = await instance.WaitForExitAsync(cancellationToken);
66+
Console.WriteLine(result.ExitCode);
67+
Console.WriteLine(result.OutputData.Count);
68+
```

0 commit comments

Comments
 (0)