1、优化LOG显示与引用

2、添加PMA工具,工具内容待完善
3、修复流程树显示
4、添加开源项目,优化UI空间
5、其他BUG更改
This commit is contained in:
liu.wenjie
2021-11-23 15:51:37 +08:00
parent 47f77f5e64
commit a24dda2525
474 changed files with 91916 additions and 6429 deletions

View File

@@ -1,137 +0,0 @@
namespace LogForm
{
partial class DetailMesForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnClose = new System.Windows.Forms.Button();
this.Rtb_DetailMes = new System.Windows.Forms.RichTextBox();
this.lb_Level = new System.Windows.Forms.Label();
this.lb_Time = new System.Windows.Forms.Label();
this.lb_Detail = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(427, 334);
this.btnClose.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(99, 33);
this.btnClose.TabIndex = 9;
this.btnClose.Text = "关闭";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// Rtb_DetailMes
//
this.Rtb_DetailMes.Location = new System.Drawing.Point(29, 140);
this.Rtb_DetailMes.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Rtb_DetailMes.Name = "Rtb_DetailMes";
this.Rtb_DetailMes.Size = new System.Drawing.Size(503, 182);
this.Rtb_DetailMes.TabIndex = 8;
this.Rtb_DetailMes.Text = "";
//
// lb_Level
//
this.lb_Level.AutoSize = true;
this.lb_Level.Location = new System.Drawing.Point(110, 57);
this.lb_Level.Name = "lb_Level";
this.lb_Level.Size = new System.Drawing.Size(0, 17);
this.lb_Level.TabIndex = 3;
//
// lb_Time
//
this.lb_Time.AutoSize = true;
this.lb_Time.Location = new System.Drawing.Point(110, 16);
this.lb_Time.Name = "lb_Time";
this.lb_Time.Size = new System.Drawing.Size(0, 17);
this.lb_Time.TabIndex = 4;
//
// lb_Detail
//
this.lb_Detail.AutoSize = true;
this.lb_Detail.Location = new System.Drawing.Point(25, 100);
this.lb_Detail.Name = "lb_Detail";
this.lb_Detail.Size = new System.Drawing.Size(79, 17);
this.lb_Detail.TabIndex = 5;
this.lb_Detail.Text = "Log详细信息";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(25, 57);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(67, 17);
this.label3.TabIndex = 6;
this.label3.Text = "Log级别";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(25, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 17);
this.label1.TabIndex = 7;
this.label1.Text = "时间:";
//
// DetailMesForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(544, 381);
this.ControlBox = false;
this.Controls.Add(this.btnClose);
this.Controls.Add(this.Rtb_DetailMes);
this.Controls.Add(this.lb_Level);
this.Controls.Add(this.lb_Time);
this.Controls.Add(this.lb_Detail);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "DetailMesForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Load += new System.EventHandler(this.DetailMesForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.RichTextBox Rtb_DetailMes;
private System.Windows.Forms.Label lb_Level;
private System.Windows.Forms.Label lb_Time;
private System.Windows.Forms.Label lb_Detail;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LogForm
{
public partial class DetailMesForm : Form
{
private string detailMsg = string.Empty;
public DetailMesForm(string detailMsg)
{
InitializeComponent();
this.detailMsg = detailMsg;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void DetailMesForm_Load(object sender, EventArgs e)
{
try
{
string time = detailMsg.Split('>')[0];
string level = detailMsg.Split(',')[0].Split('>')[1];
lb_Time.Text = time;
lb_Level.Text = level;
Rtb_DetailMes.Text = detailMsg;
}
catch (Exception)
{
Rtb_DetailMes.Text = detailMsg;
}
}
}
}

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6B38D68F-E77B-4761-BDE5-A261EA8925DD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LogForm</RootNamespace>
<AssemblyName>LogForm</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DetailMesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DetailMesForm.Designer.cs">
<DependentUpon>DetailMesForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserLogger.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserLogger.Designer.cs">
<DependentUpon>UserLogger.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DetailMesForm.resx">
<DependentUpon>DetailMesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserLogger.resx">
<DependentUpon>UserLogger.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common.ParamsList\EnumList\EnumList.csproj">
<Project>{bec2389f-b8b4-4e8a-8c71-189cde14e962}</Project>
<Name>EnumList</Name>
</ProjectReference>
<ProjectReference Include="..\Logger\Logger.csproj">
<Project>{d4e052b9-e541-4b67-a1f9-273073ef1d4b}</Project>
<Name>Logger</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LogForm")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LogForm")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("6b38d68f-e77b-4761-bde5-a261ea8925dd")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,91 +0,0 @@
namespace LogForm
{
partial class UserLogger
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.listBox1 = new System.Windows.Forms.ListBox();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ClearLog = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// listBox1
//
this.listBox1.BackColor = System.Drawing.SystemColors.Info;
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.listBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listBox1.FormattingEnabled = true;
this.listBox1.HorizontalScrollbar = true;
this.listBox1.ItemHeight = 18;
this.listBox1.Location = new System.Drawing.Point(0, 0);
this.listBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(365, 266);
this.listBox1.TabIndex = 0;
this.listBox1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.listBox1_DrawItem);
this.listBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseDoubleClick);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ClearLog});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(107, 28);
//
// ClearLog
//
this.ClearLog.Name = "ClearLog";
this.ClearLog.Size = new System.Drawing.Size(106, 24);
this.ClearLog.Text = "清空";
this.ClearLog.Click += new System.EventHandler(this.ClearLog_Click);
//
// UserLogger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.Controls.Add(this.listBox1);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "UserLogger";
this.Size = new System.Drawing.Size(365, 266);
this.Load += new System.EventHandler(this.UserLogger_Load);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem ClearLog;
}
}

View File

@@ -1,160 +0,0 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using Logger;
using System.Threading.Tasks;
using System.IO;
using System.Collections.Generic;
namespace LogForm
{
public partial class UserLogger : UserControl
{
bool logFocus = true;
string logDictory = @"C:\MyCCDSystem\Log\";
public UserLogger()
{
InitializeComponent();
}
~UserLogger()
{
logFocus = false;
}
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0)
{ return; }
else
{
e.DrawBackground();
Brush mybsh = Brushes.Black;
// 判断是什么类型的标签,在调用时必须信息前边标注信息的类别分为InfoWarningError
try
{
MsgLevel msgLevel = (MsgLevel)Enum.Parse(typeof(MsgLevel), listBox1.Items[e.Index].ToString().Split('>')[1].Trim().Split(',')[0]);
switch (msgLevel)
{
case MsgLevel.Info:
mybsh = Brushes.Green;
break;
case MsgLevel.Debug:
mybsh = Brushes.Green;
break;
case MsgLevel.Warn:
mybsh = Brushes.Purple;
break;
case MsgLevel.Exception:
case MsgLevel.Fatal:
mybsh = Brushes.Red;
break;
default:
mybsh = Brushes.Black;
break;
}
}
catch (Exception)
{
mybsh = Brushes.Green;
}
e.DrawFocusRectangle();
e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), e.Font, mybsh, e.Bounds, StringFormat.GenericDefault);
}
}
public void AddLog(MsgLevel msgLog, string logInfo)
{
try
{
this.Invoke((MethodInvoker)delegate
{
string recordMsg = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} -> {msgLog.ToString()}, {logInfo}";
listBox1.Items.Add(recordMsg);
WriteLog(recordMsg);
listBox1.SelectedIndex = listBox1.Items.Count - 1;
if (listBox1.Items.Count > 1000)
{
listBox1.Items.Clear();
}
Application.DoEvents();
});
}
catch(Exception)
{
}
}
public void AddLog(MsgLevel msgLog, string logInfo, Exception ex)
{
try
{
this.Invoke((MethodInvoker)delegate
{
listBox1.Items.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " -> " + msgLog.ToString() + "," + logInfo + ex);
listBox1.SelectedIndex = listBox1.Items.Count - 1;
WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " -> " + msgLog.ToString() + "," + logInfo + ex);
if(listBox1.Items.Count >1000)
{
listBox1.Items.Clear();
}
Application.DoEvents();
});
}
catch (Exception)
{
}
}
public void WriteLog(string msg)
{
string time = DateTime.Now.ToString("HH:mm:ss.fff");
if (!Directory.Exists(logDictory))
{
Directory.CreateDirectory(logDictory);
}
string runningLogFileName = logDictory + DateTime.Now.ToString("yyyyMMdd") + ".log";
StreamWriter mySW = new StreamWriter(runningLogFileName, true);
mySW.WriteLine(msg);
mySW.Close();
}
private void UserLogger_Load(object sender, EventArgs e)
{
Task startLogFocus = new Task(() =>
{
while (logFocus)
{
if (LoggerClass.logQueue.Count > 0)
{
LogInfo log = LoggerClass.logQueue.Dequeue();
if (log.ex != null)
{
AddLog(log.logLevel, log.message, log.ex);
}
else
{
AddLog(log.logLevel, log.message);
}
}
}
});
startLogFocus.Start();
}
private void ClearLog_Click(object sender, EventArgs e)
{
this.listBox1.Items.Clear();
}
private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if(listBox1.SelectedIndex != -1)
{
string detalText = listBox1.SelectedItem.ToString();
DetailMesForm myForm = new DetailMesForm(detalText);
myForm.Show();
}
}
}
}

View File

@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -37,6 +37,9 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -46,8 +49,25 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LogDetail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LogDetail.Designer.cs">
<DependentUpon>LogDetail.cs</DependentUpon>
</Compile>
<Compile Include="LoggerClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="UserLogger.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserLogger.Designer.cs">
<DependentUpon>UserLogger.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="log4net.config">
@@ -60,6 +80,22 @@
<Name>EnumList</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LogDetail.resx">
<DependentUpon>LogDetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="UserLogger.resx">
<DependentUpon>UserLogger.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\Log.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -10,12 +10,14 @@ namespace Logger
{
public class LoggerClass
{
public static readonly ILog loginfo = LogManager.GetLogger("loginfo");
public static readonly ILog logerror = LogManager.GetLogger("logerror");
private static readonly ILog loginfo = LogManager.GetLogger("loginfo");
private static readonly ILog logerror = LogManager.GetLogger("logerror");
/// <summary>
/// Log队列
/// </summary>
public static Queue<LogInfo> logQueue { get; set; } = new Queue<LogInfo>() { };
public static void WriteLog(string info, bool ShowMsgBox = false)
{
if (loginfo.IsInfoEnabled)
@@ -65,33 +67,11 @@ namespace Logger
}
}
}
public class LogInfo
{
public string message { get; set; }
public MsgLevel logLevel { get; set; }
public Exception ex { get; set; }
}
public enum MsgLevel
{
/// <summary>
/// 0.调试信息输出
/// </summary>
Debug = 0,
/// <summary>
/// 1.业务信息记录
/// </summary>
Info = 1,
/// <summary>
/// 2.警告提醒(捕获的业务异常)
/// </summary>
Warn = 2,
/// <summary>
/// 3.发生了异常(捕获的系统异常)
/// </summary>
Exception = 3,
/// <summary>
/// 4.发生致命异常(未被捕获的异常|捕获的业务逻辑异常)
/// </summary>
Fatal = 4
}
}