Hi.Sample.Wpf/Disp/DemoUtil.cs
2025-04-13 00:19:09 +08:00

33 lines
830 B
C#

using Hi.Disp;
using Hi.Licenses;
using Hi.MongoUtils;
using Hi.Wpf.Disp;
using System.Windows;
namespace Sample.Disp
{
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample.Wpf/Disp/DemoUtil.cs)]
/// </remarks>
public static class DemoUtil
{
public static void RunApplication(string title, IDisplayee displayee)
{
Application app = new Application();
app.Exit += (o, e) =>
{
if(MongoServer.IsDefaultInit)
MongoServer.Default.Dispose();
DispEngine.FinishDisp();
License.LogOutAll();
};
app.Run(new RenderingWindow()
{
Title = title,
Displayee = displayee
});
}
}
}