# NetworkResurrector.Agent.PublishedLanguage

[NetworkResurrector.Agent](https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector/src/branch/master/backend/src/agent) is a .NET service specialized in executing **Shutdown**, **Restart**, **Sleep**, **Logout**, and **Lock** actions on the host machine on which it is installed.

**NetworkResurrector.Agent.PublishedLanguage** is a NuGet package that contains the published language of **NetworkResurrector.Agent**. It simplifies communication with an agent instance within a .NET environment by providing essential **DTOs (Data Transfer Objects)** and constants. This package helps developers easily integrate the agent's functionality into their applications by defining clear and consistent data structures.

## Features

- Contains DTOs for exchanging data with **NetworkResurrector.Agent**.
- Provides constants that facilitate integration with the agent's API.
- Enables easy integration within .NET environments.

## Package Repository

You can install **NetworkResurrector.Agent.PublishedLanguage** from my self-hosted NuGet feed: [https://lab.code-rove.com/public-nuget-server/](https://lab.code-rove.com/public-nuget-server/)

## Installation

### Visual Studio

#### NuGet.config File

To integrate the package, configure your Visual Studio solution with the following `NuGet.config` file:
```xml=!
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="lab.nuget" value="https://lab.code-rove.com/public-nuget-server/v3/index.json" />
  </packageSources>
</configuration>
```

Add this NuGet.config file to your solution directory, or alternatively, configure the new NuGet feed in the NuGet Package Manager within Visual Studio. After doing this, you can install NetworkResurrector.Agent.PublishedLanguage using the NuGet Package Manager.


### CLI

```bash=!
dotnet add package NetworkResurrector.Agent.PublishedLanguage --source https://lab.code-rove.com/public-nuget-server/v3/index.json
```

Run the above command in a console open in a .NET project directory.

## Usage
Once installed, you can use the DTOs and constants provided by the package to communicate with the agent’s API effectively. Here's an example of how to use a DTO in your application:

```csharp
using NetworkResurrector.Agent.PublishedLanguage;

// Example usage of a DTO from the package
var shutdownDto = new ShutdownDto { Action = "Shutdown", Force = true };

// Your logic here to send the DTO to the agent
```