using DataEntity.Share; using HxUserManagement.Properties; using System; using System.ComponentModel; using System.Resources; using XCommon.Log; using XHandler.Properties; using XHandler.View; namespace XHandler.Controls.Run.Com { #region 资源文件枚举 /// /// 资源文件枚举 /// public enum Resource_Enum { /// /// Resources /// [Description("Resources")] Resources = 0, /// /// CoatingReportResource /// [Description("CoatingReportResource")] CoatingReportResource, /// /// GripTransportResource /// [Description("GripTransportResource")] GripTransportResource, /// /// LoadTipsResource /// [Description("LoadTipsResource")] LoadTipsResource, /// /// MachineRunResource /// [Description("MachineRunResource")] MachineRunResource, /// /// PauseResource /// [Description("PauseResource")] PauseResource, /// /// RunAspirateResource /// [Description("RunAspirateResource")] RunAspirateResource, /// /// RunCoatingFileResource /// [Description("RunCoatingFileResource")] RunCoatingFileResource, /// /// RunDispenseResource /// [Description("RunDispenseResource")] RunDispenseResource, /// /// RunLoadTipsResource /// [Description("RunLoadTipsResource")] RunLoadTipsResource, /// /// RunMixResource /// [Description("RunMixResource")] RunMixResource, /// /// RunTransferFileResource /// [Description("RunTransferFileResource")] RunTransferFileResource, /// /// RunUnloadTipsResource /// [Description("RunUnloadTipsResource")] RunUnloadTipsResource, /// /// TackPhotoResource /// [Description("TackPhotoResource")] TackPhotoResource, } #endregion /// /// 日志共用类 /// public class LogCom { public static void WriteRunLog(string methodName, RunWnd LaunchView, Resource_Enum resourceEnum , string key, string[] args) { string strDt = DateTime.Now.ToString("HH:mm:ss:fff"); if (!Shared.SoftwareInformation.currentculture.Equals("zh-CN")) { key += "_Eng"; } ResourceManager rm = new ResourceManager(typeof(Properties.Resources)); string strVal = rm.GetString(key); string strLastVal = string.Format(strVal, args); //string strVal = Resources.ResourceManager.GetObject(key).ToString(); string strOutLog = string.Format("【{0}】> Xhandler: 【{1}】{2}", strDt, methodName, strLastVal); LaunchView.AddLogs(strOutLog); } } }