Skip to content

Commit

Permalink
Merge pull request #148 from DevyusCode/doc
Browse files Browse the repository at this point in the history
Updated documentation
  • Loading branch information
lpeyr authored Sep 30, 2023
2 parents ee68451 + 53e9484 commit d5d2266
Show file tree
Hide file tree
Showing 213 changed files with 1,642 additions and 1,275 deletions.
8 changes: 4 additions & 4 deletions Documentation/.vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"hash": "44ac7ce3",
"browserHash": "3699f0c8",
"hash": "3f44673d",
"browserHash": "7f849b1e",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "380e6e7c",
"fileHash": "573735cd",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/@vue/devtools-api/lib/esm/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "944a23b0",
"fileHash": "3beed624",
"needsInterop": false
}
},
Expand Down
2 changes: 1 addition & 1 deletion Documentation/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
},
{
icon: "youtube",
link: "https://www.youtube.com/channel/UC283Dtf6EJ8eKfRoo0ISmqg",
link: "https://www.youtube.com/@PeyronnetGroup/",
},
],
outline: [1, 3],
Expand Down
55 changes: 45 additions & 10 deletions Documentation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

165 changes: 165 additions & 0 deletions Documentation/ui-helpers/windowhelpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,168 @@ public class MyWindowManager
}
}
```

### CloseWindow(windowInfo)

#### Definition

Closes a window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | -------------------- |
| `WindowInfo` | `windowInfo` | The window to close. |

#### Usage

```c#
using PeyrSharp.UiHelpers;
using System.Linq;

var ws = WindowHelpers.GetWindows();
var w = ws.Where(x => x.ClassName == "Notepad").First();
WindowHelpers.CloseWindow(w)
```

### MaximizeWindow(windowInfo)

#### Definition

Maximizes a window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ----------------------- |
| `WindowInfo` | `windowInfo` | The window to maximize. |

#### Usage

```c#
using PeyrSharp.UiHelpers;
using System.Linq;

var ws = WindowHelpers.GetWindows();
var w = ws.Where(x => x.ClassName == "Notepad").First();
WindowHelpers.MaximizeWindow(w)
```

### RestoreWindow(windowInfo)

#### Definition

Restores a window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ---------------------- |
| `WindowInfo` | `windowInfo` | The window to restore. |

#### Usage

```c#
using PeyrSharp.UiHelpers;
using System.Linq;

var ws = WindowHelpers.GetWindows();
var w = ws.Where(x => x.ClassName == "Notepad").First();
WindowHelpers.RestoreWindow(w)
```

### MinimizeWindow(windowInfo)

#### Definition

Minimizes a window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ----------------------- |
| `WindowInfo` | `windowInfo` | The window to minimize. |

#### Usage

```c#
using PeyrSharp.UiHelpers;
using System.Linq;

var ws = WindowHelpers.GetWindows();
var w = ws.Where(x => x.ClassName == "Notepad").First();
WindowHelpers.MinimizeWindow(w)
```

### MoveWindow(windowInfo, x, y)

#### Definition

Moves a window to specified coordinates.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ----------------------- |
| `WindowInfo` | `windowInfo` | The window to move. |
| `int` | `x` | The X-axis coordinates. |
| `int` | `y` | The Y-axis coordinates. |

#### Usage

```c#
using PeyrSharp.UiHelpers;

WindowHelpers.MoveWindow(w, 100, 200); // w is a WindowInfo object, see previous examples.
```

### SetTopMost(windowInfo, isTopMost)

#### Definition

Sets the Topmost property of a window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ---------------------------------- |
| `WindowInfo` | `windowInfo` | The window to target. |
| `bool` | `isTopMost` | The value of the TopMost property. |

::: info Note
The `isTopMost` parameter can be set to `true` if the window should always stay on top; `false` otherwise.
:::

#### Usage

```c#
using PeyrSharp.UiHelpers;
WindowHelpers.SetTopMost(w, true)
```

### GetWindowSize(windowInfo)

#### Definition

Gets the width and height of a window. It returns a tuple of integers representing the width and height of the window.

#### Arguments

| Type | Name | Meaning |
| ------------ | ------------ | ------------------------------ |
| `WindowInfo` | `windowInfo` | The window to get the size of. |

#### Exceptions

| Type | Description |
| --------------------------- | ----------------------------------------- |
| `InvalidOperationException` | Thrown if failed to retrieve window size. |

#### Usage

```c#
using PeyrSharp.UiHelpers;

var size = WindowHelpers.GetWindowSize(w); // w is a WindowInfo object, see previous examples.
Console.WriteLine($"Width: {size.Item1}, Height: {size.Item2}");
```
Loading

0 comments on commit d5d2266

Please sign in to comment.