narsil/Tanshu.Accounts.Print/ThermalPrinter.cs

20 lines
509 B
C#
Raw Normal View History

using System;
namespace Tanshu.Accounts.Print
{
internal class ThermalPrinter
{
internal static PlatformPrinter Printer;
static ThermalPrinter()
{
Printer = RunningOnLinux() ? (PlatformPrinter)new PrinterLinux() : new PrinterWindows();
}
internal static bool RunningOnLinux()
{
var platform = (int)Environment.OSVersion.Platform;
return (platform == 4) || (platform == 6) || (platform == 128);
}
}
}