执行代码清理,修复warning

This commit is contained in:
2023-11-06 19:59:12 +08:00
parent c6b8dfc861
commit 1dbb17f103
118 changed files with 5046 additions and 4111 deletions

View File

@@ -4,22 +4,19 @@ namespace Tnb.WarehouseMgr.Print
{
public class PPLBUtility
{
const uint IMAGE_BITMAP = 0;
const uint LR_LOADFROMFILE = 16;
static readonly string dllPath = Path.Combine(AppContext.BaseDirectory, @"Library\x64", "Library\\x64\\Winpplb.dll");
private const uint IMAGE_BITMAP = 0;
private const uint LR_LOADFROMFILE = 16;
private static readonly string dllPath = Path.Combine(AppContext.BaseDirectory, @"Library\x64", "Library\\x64\\Winpplb.dll");
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType,
private static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType,
int cxDesired, int cyDesired, uint fuLoad);
[DllImport("Gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
static extern int DeleteObject(IntPtr ho);
private static extern int DeleteObject(IntPtr ho);
public const string szSavePath = "C:\\Argox";
public const string szSaveFile = "C:\\Argox\\PPLB_Example.Prn";
const string sznop1 = "nop_front\r\n";
const string sznop2 = "nop_middle\r\n";
private const string sznop1 = "nop_front\r\n";
private const string sznop2 = "nop_middle\r\n";
/// <summary>
/// 印出一个 Maxi Code 2D Barcode
/// </summary>
@@ -60,8 +57,15 @@ namespace Tnb.WarehouseMgr.Print
///打印方向,'0是 0°'1是90°、'2是180°'3是270°
///
/// </param>
/// <param name="h"></param>
/// <param name="pParameter"></param>
/// <param name="v"></param>
/// <param name="s"></param>
/// <param name="c"></param>
/// <param name="px"></param>
/// <param name="py"></param>
/// <param name="r"></param>
/// <param name="l"></param>
/// <param name="t"></param>
/// <param name="o"></param>
/// <param name="data">资料字串。</param>
/// <returns></returns>
[DllImport("Library\\x64\\Library\\x64\\Winpplb.dll")]
@@ -527,13 +531,12 @@ namespace Tnb.WarehouseMgr.Print
/// 0 -> OK.
/// Reference BW-Error.txt file.
/// </returns>
///<example>
/// <example>
///B_Prn_Text(50, 110, 0, 4, 1, 1, N, “A123456”); //无跳号功能
///or
///B_Prn_Text(50, 110, 0, 4, 1, 1, N, “A123456<-1>”); //有跳号功能
/// </example>
public static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor,
int ver_factor, char mode, string data);
public static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor, int ver_factor, char mode, string data);
/// <summary>
/// 打印出一行文字,使用中文字型档案 (1615 或 2424)
/// </summary>
@@ -551,8 +554,7 @@ namespace Tnb.WarehouseMgr.Print
///(1615 或 2424)。
/// </remarks>
[DllImport("Library\\x64\\Winpplb.dll")]
public static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name,
string data);
public static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name, string data);
/// <summary>
/// 打印Windows仿真字
/// </summary>