41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Hi.Disp;
|
|
using Hi.Licenses;
|
|
using Hi.MongoUtils;
|
|
using System;
|
|
|
|
namespace Sample
|
|
{
|
|
/// <summary>
|
|
/// A sample class demonstrating initialization and usage of the HiAPI framework.
|
|
/// Shows the basic setup of display engine, MongoDB server, licensing, and other core functionality.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This example serves as an entry point for those getting started with HiAPI.
|
|
/// It demonstrates proper initialization and teardown of key components.
|
|
/// ### Source Code
|
|
/// [!code-csharp[SampleCode](~/../Hi.Sample/HelloHiAPI.cs)]
|
|
/// </remarks>
|
|
public static class HelloHiAPI
|
|
{
|
|
static int Main(string[] args)
|
|
{
|
|
Console.WriteLine("HiAPI starting.");
|
|
License.LogInAll();
|
|
DispEngine.Init();
|
|
MongoServer.Default = MongoServer.Run(new MongoRunnerOptions()
|
|
{
|
|
MongoPort = 28100
|
|
});
|
|
|
|
Console.WriteLine("Hello World! HiAPI.");
|
|
|
|
MongoServer.Default.Dispose();
|
|
DispEngine.FinishDisp();
|
|
License.LogOutAll();
|
|
Console.WriteLine("HiAPI exited.");
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|