![]() |
VOOZH | about |
dotnet add package Crestron.SimplSharp.SDK.Program --version 2.21.257
NuGet\Install-Package Crestron.SimplSharp.SDK.Program -Version 2.21.257
<PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.21.257" />
<PackageVersion Include="Crestron.SimplSharp.SDK.Program" Version="2.21.257" />Directory.Packages.props
<PackageReference Include="Crestron.SimplSharp.SDK.Program" />Project file
paket add Crestron.SimplSharp.SDK.Program --version 2.21.257
#r "nuget: Crestron.SimplSharp.SDK.Program, 2.21.257"
#:package Crestron.SimplSharp.SDK.Program@2.21.257
#addin nuget:?package=Crestron.SimplSharp.SDK.Program&version=2.21.257Install as a Cake Addin
#tool nuget:?package=Crestron.SimplSharp.SDK.Program&version=2.21.257Install as a Cake Tool
<p align="center"><img src="images/crestron_logo_nuget.jpg"></p> <h1 align="center"> Crestron.SimplSharp.SDK.Program</a></h1> <p align="center">Crestron's 4-Series appliances and server based Virtual Control enable you to program your system in C#. This package includes all the necessary libraries needed to create a C# Program that runs on 4-Series or Virtual Control.</p>
To program your Crestron system in C#, follow these steps:
Install the package via NuGet. You can use the following command in the Package Manager Console:
dotnet add package Crestron.SimplSharp.SDK.Program
Import these namespaces in your code file(s) at a minimum:
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
Depending on your application and the devices used, you might need to import additional namespaces.
Create a class that inherits from CrestronControlSystem and add a parameterless constructor: The constructor needs to exit in a timely fashion, otherwise the program will exit. You cannot send/receive data in the constructor
public class ControlSystem : CrestronControlSystem
{
public ControlSystem() : base()
{
try
{
// Initialize Crestron threadpool
Crestron.SimplSharpPro.CrestronThread.Thread.MaxNumberOfUserThreads = 20;
}
catch (Exception e)
{
ErrorLog.Error("Error in the constructor: {0}", e.Message);
}
}
}
Use the constructor to:
Add InitializeSystem() This method gets called after the constructor has finished. InitializeSystem() needs to exit in a timely fashion, otherwise the program will exit.
public override void InitializeSystem()
{
try
{
}
catch (Exception e)
{
ErrorLog.Error("Error in InitializeSystem: {0}", e.Message);
}
}
Use InitializeSystem to:
Subscribe to controller events
Program Status Events Event handler for programmatic events, such as program stop, pause, and resume. Handling the program stopping scenario is mandatory.
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(ControllerProgramEventHandler);
void ControllerProgramEventHandler(eProgramStatusEventType programStatusEventType)
{
switch (programStatusEventType)
{
case (eProgramStatusEventType.Paused):
// The program has been paused. Pause all user threads/timers as needed.
break;
case (eProgramStatusEventType.Resumed):
// The program has been resumed. Resume all the user threads/timers as needed.
break;
case (eProgramStatusEventType.Stopping):
// The program has been stopped.
// Close all threads.
// Shutdown all Client/Servers in the system.
// General cleanup.
// Unsubscribe to all System Monitor events
break;
}
}
OPTIONAL: System Events Event handler for system events, such as disk inserted/ejected, and system reboot
CrestronEnvironment.SystemEventHandler += new SystemEventHandler(ControllerSystemEventHandler);
void ControllerSystemEventHandler(eSystemEventType systemEventType)
{
switch (systemEventType)
{
case (eSystemEventType.DiskInserted):
// Removable media was detected on the system
break;
case (eSystemEventType.DiskRemoved):
// Removable media was detached from the system
break;
case (eSystemEventType.Rebooting):
// The system is rebooting.
// Very limited time to preform clean up and save any settings to disk.
break;
}
}
OPTIONAL: Ethernet Events Event handler for ethernet events, such as link up / link down
CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(ControllerEthernetEventHandler);
void _ControllerEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
{
switch (ethernetEventArgs.EthernetEventType)
{
//Determine the event type Link Up or Link Down
case (eEthernetEventType.LinkDown):
//Next need to determine which adapter the event is for.
//LAN is the adapter is the port connected to external networks.
if (ethernetEventArgs.EthernetAdapter == EthernetAdapterType.EthernetLANAdapter)
{
}
break;
case (eEthernetEventType.LinkUp):
if (ethernetEventArgs.EthernetAdapter == EthernetAdapterType.EthernetLANAdapter)
{
}
break;
}
}
Additional documentation can be found <a href="https://community.crestron.com/s/article/id-1000637">here</a></p>
This project is licensed under the .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 NuGet packages that depend on Crestron.SimplSharp.SDK.Program:
| Package | Downloads |
|---|---|
|
PepperDashEssentials
Package Description |
|
|
Crestron.SimplSharp.SDK.SandboxProgram
A version of Crestron.SimplSharp.SDK.Program suitable for use with a 3-series sandbox build. See https://github.com/scottpidzarko/CrestronSandboxBuild This project pulls the required files from the Device Database. You MUST have the S# plugin and everything it requires installed for this package to function. |
|
|
Vistacom.Class.Library
Vistacom.Class.Library is a specialized software library designed for Crestron control systems. This library is tailored to work with Crestron devices and is equipped with Application Programming Interfaces (APIs) that facilitate the seamless control of various devices through the Simpl# programming language. With Vistacom.Class.Library, Crestron integrators and developers can efficiently manage and interact with a wide range of devices, making it an essential tool for creating custom control solutions within the Crestron ecosystem. This library streamlines the process of programming and controlling devices, enhancing the capabilities and functionality of Crestron-based systems. |
Showing the top 1 popular GitHub repositories that depend on Crestron.SimplSharp.SDK.Program:
| Repository | Stars |
|---|---|
|
PepperDash/Essentials
The Essentials Application Framework Libraries
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.21.257 | 471 | 6/2/2026 |
| 2.21.252 | 411 | 5/12/2026 |
| 2.21.237 | 1,173 | 3/31/2026 |
| 2.21.226 | 708 | 3/3/2026 |
| 2.21.184 | 1,537 | 12/23/2025 |
| 2.21.182 | 491 | 12/17/2025 |
| 2.21.177 | 805 | 12/9/2025 |
| 2.21.171 | 1,733 | 10/14/2025 |
| 2.21.157 | 1,341 | 9/9/2025 |
| 2.21.133 | 1,386 | 7/29/2025 |
| 2.21.128 | 1,802 | 7/1/2025 |
| 2.21.121 | 1,441 | 6/3/2025 |
| 2.21.110 | 2,267 | 4/23/2025 |
| 2.21.90 | 9,227 | 12/26/2024 |
| 2.21.68 | 2,007 | 11/12/2024 |
| 2.21.65 | 1,588 | 10/30/2024 |
| 2.21.54 | 2,023 | 10/9/2024 |
| 2.20.66 | 6,925 | 4/30/2024 |
| 2.20.63 | 486 | 4/23/2024 |