Package Description
$ dotnet add package UXAV.AVnet.CoreTo use this test library in your project, follow these steps:
Install the package via NuGet. You can use the following command in the Package Manager Console:
dotnet add [<PROJECT>] package UXAV.AVnet.Core
Import the library classes in your code file(s):
using UXAV.AVnet.Core.Models;
using UXAV.AVnet.Core.Models.Diagnostics;
using UXAV.Logging;
Create a class that inherits from SystemBase:
public class MySystem : SystemBase
{
public MySystem(CrestronControlSystem controlSystem) : base(controlSystem)
{
// create all your instance logic here and any instances of rooms, devices or
}
protected override void AppShouldRunUpgradeScripts()
{
// called when the program starts with a new version number
}
protected override void OnProgramStatusEventHandler(eProgramStatusEventType eventType)
{
if (eventType == eProgramStatusEventType.Stopping)
{
// anything you need to save, disconnect or stop... the program is stopping
}
}
protected override IEnumerable<DiagnosticMessage> GenerateDiagnosticMessages()
{
return new DiagnosticMessage[]
{
// add any diagnostic messages here,
// this is called for when the system needs to update the
// status of stuff or the dashboard app requests it
};
}
protected override void SystemShouldAddItemsToInitialize(Action<IInitializable> addItem)
{
addItem(myDeviceWithInitialization);
addItem(myOtherDeviceWithInitialization);
}
protected override void WebScriptingHandlersShouldRegister()
{
// any web scripting handlers for API's can and should register here (see docs)
}
}
Load and Initialize your main instance of system
public class ControlSystem : CrestronControlSystem
{
private readonly SystemBase _mySystem;
public ControlSystem()
{
try
{
// create your instance of MySystem
_mySystem = new MySystem(this);
}
catch (Exception e)
{
Logger.Error(e);
}
}
public override void InitializeSystem()
{
try
{
// start the initializing of MySystem
_mySystem?.Initialize();
}
catch (Exception e)
{
Logger.Error(e);
}
}
}
GitHub Repository: AVnetCore
NuGet Package: UXAV.AVnet.Core
Documentation can be viewed in GitHub Pages
Contributions are welcome! If you would like to contribute to this project, please follow these guidelines:
Please ensure that your code follows the project's coding conventions and includes appropriate tests.
feature/feature-nameThank you for your interest in contributing to this project!
This project is licensed under the MIT License.