-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
32 changed files
with
1,300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Your GitHub workflow file under .github/workflows/ | ||
# Trigger the action on push to main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
actions: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
publish-docs: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Dotnet Setup | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.x | ||
|
||
- run: dotnet tool update -g docfx | ||
- run: docfx Docs/docfx.json | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload entire repository | ||
path: 'Docs/_site' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -421,3 +421,6 @@ $RECYCLE.BIN/ | |
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
*/_site | ||
*/api* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"metadata": [ | ||
{ | ||
"src": [ | ||
{ | ||
"src": "../System", | ||
"files": [ | ||
"**/*.csproj" | ||
] | ||
} | ||
], | ||
"dest": "api.System" | ||
}, | ||
{ | ||
"src": [ | ||
{ | ||
"src": "../Web", | ||
"files": [ | ||
"**/*.csproj" | ||
] | ||
} | ||
|
||
], | ||
"dest": "api.Web" | ||
} | ||
], | ||
"build": { | ||
"content": [ | ||
{ | ||
"files": [ | ||
"**/*.{md,yml}" | ||
], | ||
"exclude": [ | ||
"_site/**" | ||
] | ||
} | ||
], | ||
"resource": [ | ||
{ | ||
"files": [ | ||
"images/**" | ||
] | ||
} | ||
], | ||
"output": "_site", | ||
"template": [ | ||
"default", | ||
"modern", | ||
"templates/material" | ||
], | ||
"globalMetadata": { | ||
"_appName": "Tools", | ||
"_appTitle": "Tools", | ||
"_appLogoPath": "images/logo.png", | ||
"_enableSearch": true, | ||
"pdf": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Awake | ||
|
||
Module is exported from Microsoft Powertoys under license MIT. | ||
|
||
>[!NOTE] | ||
>Works only for Windows host | ||
|
||
## V1 | ||
|
||
Simple usage | ||
|
||
```C# | ||
using FrApps42.System.Computer.Awake.v1; | ||
... | ||
|
||
// Keep Screen on | ||
Awake..SetIndefiniteKeepAwake(true); | ||
// Keep Screen off | ||
Awake..SetIndefiniteKeepAwake(false); | ||
|
||
// Disable Keep Awake | ||
Awake.SetNoKeepAwake(); | ||
|
||
... | ||
|
||
Awake.CompleteExit(0, false, "AppName"); | ||
|
||
``` | ||
|
||
If you want to log Awake error | ||
|
||
```C# | ||
using FrApps42.System.Computer.Awake.v1; | ||
... | ||
|
||
private static void LogUnexpectedOrCancelledKeepAwakeThreadCompletion(){ | ||
Console.WriteLine("The keep-awake thread was terminated early."); | ||
} | ||
|
||
private static void LogCompletedKeepAwakeThread(bool result) | ||
{ | ||
Console.WriteLine($"Exited keep-awake thread successfully: {result}"); | ||
} | ||
|
||
// Keep Screen on | ||
Awake..SetIndefiniteKeepAwake(LogCompletedKeepAwakeThread, LogUnexpectedOrCancelledKeepAwakeThreadCompletion,true); | ||
// Keep Screen off | ||
Awake..SetIndefiniteKeepAwake(LogCompletedKeepAwakeThread, LogUnexpectedOrCancelledKeepAwakeThreadCompletion,false); | ||
|
||
// Disable Keep Awake | ||
Awake.SetNoKeepAwake(); | ||
|
||
... | ||
|
||
Awake.CompleteExit(0, false, "AppName"); | ||
|
||
``` | ||
|
||
## V2 | ||
|
||
Updated version of Power Awake | ||
|
||
```C# | ||
using FrApps42.System.Computer.Awake.v1; | ||
... | ||
|
||
private static void LogUnexpectedOrCancelledKeepAwakeThreadCompletion(){ | ||
Console.WriteLine("The keep-awake thread was terminated early."); | ||
} | ||
|
||
private static void LogCompletedKeepAwakeThread(bool result) | ||
{ | ||
Console.WriteLine($"Exited keep-awake thread successfully: {result}"); | ||
} | ||
|
||
// Keep Screen on | ||
Awake..SetIndefiniteKeepAwake(true); | ||
// Keep Screen off | ||
Awake..SetIndefiniteKeepAwake(false); | ||
|
||
// Keep Awake for a specified seconds with screen on | ||
Awake.SetTimedKeepAwake(3600, true); | ||
// Keep Awake for a specified seconds with screen off | ||
Awake.SetTimedKeepAwake(3600, false); | ||
|
||
// Disable Keep Awake | ||
Awake.SetNoKeepAwake(); | ||
|
||
``` | ||
|
||
In V2, be sure to disable KeepAwake before app closing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# NET | ||
|
||
>[!NOTE] | ||
> Tested on Windows, should works on Linux and MacOS | ||
## IsOnline | ||
|
||
Simple class to test if computer is Online. | ||
|
||
```C# | ||
using FrApps42.System.Net;` | ||
|
||
|
||
bool result = (new IsOnline("8.8.8.8")).Check(); | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Shutdown | ||
|
||
>[!NOTE] | ||
>Works only for Windows host | ||
Simple lib to shutdown local or remote Windows computer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Introduction | ||
|
||
Available Namespace : | ||
- System | ||
- Web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- name: Introduction | ||
href: introduction.md | ||
- name: Shutdown | ||
href: Shutdown.md | ||
- name: Awake | ||
href: Awake.md | ||
- name: Net | ||
href: Net.md |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
_layout: landing | ||
--- | ||
|
||
<meta http-equiv="refresh" content="0; url=docs/introduction.html" /> |
Oops, something went wrong.