..
This commit is contained in:
66
Cs_HMI/Project/Dialog/fLog.Designer.cs
generated
66
Cs_HMI/Project/Dialog/fLog.Designer.cs
generated
@@ -33,13 +33,13 @@
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.rtXbee = new arCtl.LogTextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.titleXBEE = new System.Windows.Forms.Label();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.rtBMS = new arCtl.LogTextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.titleBMS = new System.Windows.Forms.Label();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.rtAGV = new arCtl.LogTextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.titleAGV = new System.Windows.Forms.Label();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
@@ -112,7 +112,7 @@
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.rtXbee);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.titleXBEE);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(173, 349);
|
||||
this.panel1.Name = "panel1";
|
||||
@@ -139,21 +139,21 @@
|
||||
this.rtXbee.TabIndex = 2;
|
||||
this.rtXbee.Text = "";
|
||||
//
|
||||
// label1
|
||||
// titleXBEE
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(164, 14);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "MC ID";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.titleXBEE.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.titleXBEE.Location = new System.Drawing.Point(0, 0);
|
||||
this.titleXBEE.Name = "titleXBEE";
|
||||
this.titleXBEE.Size = new System.Drawing.Size(164, 14);
|
||||
this.titleXBEE.TabIndex = 0;
|
||||
this.titleXBEE.Text = "MC ID";
|
||||
this.titleXBEE.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.panel2, 2);
|
||||
this.panel2.Controls.Add(this.rtBMS);
|
||||
this.panel2.Controls.Add(this.label3);
|
||||
this.panel2.Controls.Add(this.titleBMS);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(343, 349);
|
||||
this.panel2.Name = "panel2";
|
||||
@@ -180,20 +180,20 @@
|
||||
this.rtBMS.TabIndex = 2;
|
||||
this.rtBMS.Text = "";
|
||||
//
|
||||
// label3
|
||||
// titleBMS
|
||||
//
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label3.Location = new System.Drawing.Point(0, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(335, 14);
|
||||
this.label3.TabIndex = 3;
|
||||
this.label3.Text = "BMS";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.titleBMS.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.titleBMS.Location = new System.Drawing.Point(0, 0);
|
||||
this.titleBMS.Name = "titleBMS";
|
||||
this.titleBMS.Size = new System.Drawing.Size(335, 14);
|
||||
this.titleBMS.TabIndex = 3;
|
||||
this.titleBMS.Text = "BMS";
|
||||
this.titleBMS.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Controls.Add(this.rtAGV);
|
||||
this.panel4.Controls.Add(this.label2);
|
||||
this.panel4.Controls.Add(this.titleAGV);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel4.Location = new System.Drawing.Point(3, 349);
|
||||
this.panel4.Name = "panel4";
|
||||
@@ -220,15 +220,15 @@
|
||||
this.rtAGV.TabIndex = 2;
|
||||
this.rtAGV.Text = "";
|
||||
//
|
||||
// label2
|
||||
// titleAGV
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label2.Location = new System.Drawing.Point(0, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(164, 14);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "AGV";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.titleAGV.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.titleAGV.Location = new System.Drawing.Point(0, 0);
|
||||
this.titleAGV.Name = "titleAGV";
|
||||
this.titleAGV.Size = new System.Drawing.Size(164, 14);
|
||||
this.titleAGV.TabIndex = 3;
|
||||
this.titleAGV.Text = "AGV";
|
||||
this.titleAGV.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// fLog
|
||||
//
|
||||
@@ -258,10 +258,10 @@
|
||||
private arCtl.LogTextBox rtBMS;
|
||||
private arCtl.LogTextBox rtXbee;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label titleXBEE;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label titleBMS;
|
||||
private System.Windows.Forms.Label titleAGV;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,9 @@ namespace Project.Dialog
|
||||
|
||||
private void fLog_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.label1.Text = $"XBEE:{PUB.setting.XBE_ID}";
|
||||
this.titleXBEE.Text = $"XBEE({PUB.setting.Port_XBE},ID:{PUB.setting.XBE_ID})";
|
||||
this.titleAGV.Text = $"AGV({PUB.setting.Port_AGV}:{PUB.setting.Baud_AGV})";
|
||||
this.titleBMS.Text = $"BMS({PUB.setting.Port_BAT}:{PUB.setting.Baud_BAT})";
|
||||
var colorlist = new arCtl.sLogMessageColor[]
|
||||
{
|
||||
new arCtl.sLogMessageColor("NOR",Color.Black),
|
||||
|
||||
231
Cs_HMI/Project/Dialog/fXbeeSetting.Designer.cs
generated
Normal file
231
Cs_HMI/Project/Dialog/fXbeeSetting.Designer.cs
generated
Normal file
@@ -0,0 +1,231 @@
|
||||
namespace Project.Dialog
|
||||
{
|
||||
partial class fXbeeSetting
|
||||
{
|
||||
/// <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.button1 = new System.Windows.Forms.Button();
|
||||
this.tbBaud = new System.Windows.Forms.TextBox();
|
||||
this.tbPortName = new System.Windows.Forms.ComboBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.rtXbee = new arCtl.LogTextBox();
|
||||
this.tbpanid = new System.Windows.Forms.TextBox();
|
||||
this.btpand = new System.Windows.Forms.Button();
|
||||
this.btch = new System.Windows.Forms.Button();
|
||||
this.tbch = new System.Windows.Forms.TextBox();
|
||||
this.btmy = new System.Windows.Forms.Button();
|
||||
this.tbmy = new System.Windows.Forms.TextBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(25, 45);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(227, 26);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "open/close";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// tbBaud
|
||||
//
|
||||
this.tbBaud.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tbBaud.Location = new System.Drawing.Point(152, 13);
|
||||
this.tbBaud.Name = "tbBaud";
|
||||
this.tbBaud.Size = new System.Drawing.Size(100, 26);
|
||||
this.tbBaud.TabIndex = 2;
|
||||
this.tbBaud.Text = "9600";
|
||||
this.tbBaud.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// tbPortName
|
||||
//
|
||||
this.tbPortName.Font = new System.Drawing.Font("굴림", 12F);
|
||||
this.tbPortName.FormattingEnabled = true;
|
||||
this.tbPortName.Location = new System.Drawing.Point(25, 15);
|
||||
this.tbPortName.Name = "tbPortName";
|
||||
this.tbPortName.Size = new System.Drawing.Size(121, 24);
|
||||
this.tbPortName.TabIndex = 3;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.button2);
|
||||
this.panel1.Controls.Add(this.btmy);
|
||||
this.panel1.Controls.Add(this.tbmy);
|
||||
this.panel1.Controls.Add(this.btch);
|
||||
this.panel1.Controls.Add(this.tbch);
|
||||
this.panel1.Controls.Add(this.btpand);
|
||||
this.panel1.Controls.Add(this.tbpanid);
|
||||
this.panel1.Controls.Add(this.tbPortName);
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Controls.Add(this.tbBaud);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(580, 118);
|
||||
this.panel1.TabIndex = 4;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.rtXbee);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 118);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(580, 338);
|
||||
this.panel2.TabIndex = 5;
|
||||
//
|
||||
// rtXbee
|
||||
//
|
||||
this.rtXbee.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
this.rtXbee.ColorList = new arCtl.sLogMessageColor[0];
|
||||
this.rtXbee.DateFormat = "mm:ss.fff";
|
||||
this.rtXbee.DefaultColor = System.Drawing.Color.LightGray;
|
||||
this.rtXbee.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.rtXbee.EnableDisplayTimer = false;
|
||||
this.rtXbee.EnableGubunColor = true;
|
||||
this.rtXbee.Font = new System.Drawing.Font("맑은 고딕", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.rtXbee.ListFormat = "[{0}] {1}";
|
||||
this.rtXbee.Location = new System.Drawing.Point(0, 0);
|
||||
this.rtXbee.MaxListCount = ((ushort)(1000));
|
||||
this.rtXbee.MaxTextLength = ((uint)(400000u));
|
||||
this.rtXbee.MessageInterval = 50;
|
||||
this.rtXbee.Name = "rtXbee";
|
||||
this.rtXbee.Size = new System.Drawing.Size(580, 338);
|
||||
this.rtXbee.TabIndex = 2;
|
||||
this.rtXbee.Text = "";
|
||||
//
|
||||
// tbpanid
|
||||
//
|
||||
this.tbpanid.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tbpanid.Location = new System.Drawing.Point(374, 15);
|
||||
this.tbpanid.Name = "tbpanid";
|
||||
this.tbpanid.Size = new System.Drawing.Size(100, 26);
|
||||
this.tbpanid.TabIndex = 4;
|
||||
this.tbpanid.Text = "9600";
|
||||
this.tbpanid.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btpand
|
||||
//
|
||||
this.btpand.Location = new System.Drawing.Point(480, 15);
|
||||
this.btpand.Name = "btpand";
|
||||
this.btpand.Size = new System.Drawing.Size(86, 26);
|
||||
this.btpand.TabIndex = 5;
|
||||
this.btpand.Text = "PanID";
|
||||
this.btpand.UseVisualStyleBackColor = true;
|
||||
this.btpand.Click += new System.EventHandler(this.btpand_Click);
|
||||
//
|
||||
// btch
|
||||
//
|
||||
this.btch.Location = new System.Drawing.Point(480, 47);
|
||||
this.btch.Name = "btch";
|
||||
this.btch.Size = new System.Drawing.Size(86, 26);
|
||||
this.btch.TabIndex = 7;
|
||||
this.btch.Text = "Channel";
|
||||
this.btch.UseVisualStyleBackColor = true;
|
||||
this.btch.Click += new System.EventHandler(this.btch_Click);
|
||||
//
|
||||
// tbch
|
||||
//
|
||||
this.tbch.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tbch.Location = new System.Drawing.Point(374, 47);
|
||||
this.tbch.Name = "tbch";
|
||||
this.tbch.Size = new System.Drawing.Size(100, 26);
|
||||
this.tbch.TabIndex = 6;
|
||||
this.tbch.Text = "9600";
|
||||
this.tbch.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btmy
|
||||
//
|
||||
this.btmy.Location = new System.Drawing.Point(480, 78);
|
||||
this.btmy.Name = "btmy";
|
||||
this.btmy.Size = new System.Drawing.Size(86, 26);
|
||||
this.btmy.TabIndex = 9;
|
||||
this.btmy.Text = "My";
|
||||
this.btmy.UseVisualStyleBackColor = true;
|
||||
this.btmy.Click += new System.EventHandler(this.btmy_Click);
|
||||
//
|
||||
// tbmy
|
||||
//
|
||||
this.tbmy.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tbmy.Location = new System.Drawing.Point(374, 78);
|
||||
this.tbmy.Name = "tbmy";
|
||||
this.tbmy.Size = new System.Drawing.Size(100, 26);
|
||||
this.tbmy.TabIndex = 8;
|
||||
this.tbmy.Text = "9600";
|
||||
this.tbmy.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(293, 15);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 89);
|
||||
this.button2.TabIndex = 10;
|
||||
this.button2.Text = "Read Setting";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// fXbeeSetting
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(580, 456);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "fXbeeSetting";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Form1";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.fXbeeSetting_FormClosed);
|
||||
this.Load += new System.EventHandler(this.fXbeeSetting_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.TextBox tbBaud;
|
||||
private System.Windows.Forms.ComboBox tbPortName;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private arCtl.LogTextBox rtXbee;
|
||||
private System.Windows.Forms.Button btpand;
|
||||
private System.Windows.Forms.TextBox tbpanid;
|
||||
private System.Windows.Forms.Button btmy;
|
||||
private System.Windows.Forms.TextBox tbmy;
|
||||
private System.Windows.Forms.Button btch;
|
||||
private System.Windows.Forms.TextBox tbch;
|
||||
private System.Windows.Forms.Button button2;
|
||||
}
|
||||
}
|
||||
89
Cs_HMI/Project/Dialog/fXbeeSetting.cs
Normal file
89
Cs_HMI/Project/Dialog/fXbeeSetting.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
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 Project.Dialog
|
||||
{
|
||||
public partial class fXbeeSetting : Form
|
||||
{
|
||||
public fXbeeSetting()
|
||||
{
|
||||
InitializeComponent();
|
||||
PUB.logxbee.RaiseMsg += Log_RaiseMsgcal;
|
||||
}
|
||||
private void fXbeeSetting_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.tbPortName.Items.Clear();
|
||||
foreach (var item in System.IO.Ports.SerialPort.GetPortNames())
|
||||
{
|
||||
this.tbPortName.Items.Add(item);
|
||||
}
|
||||
|
||||
this.tbPortName.Text = PUB.setting.Port_XBE;
|
||||
this.tbBaud.Text = PUB.setting.Baud_XBE.ToString();
|
||||
}
|
||||
private void Log_RaiseMsgcal(DateTime LogTime, string TypeStr, string Message)
|
||||
{
|
||||
showlog(rtXbee, LogTime, TypeStr, Message);
|
||||
}
|
||||
void showlog(arCtl.LogTextBox rtRx, DateTime LogTime, string TypeStr, string Message)
|
||||
{
|
||||
if (rtRx.Visible)
|
||||
{
|
||||
rtRx.AddMsg(LogTime, TypeStr, Message);
|
||||
}
|
||||
}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (PUB.XBE.IsOpen)
|
||||
PUB.XBE.Close();
|
||||
else
|
||||
{
|
||||
PUB.XBE.PortName = tbPortName.Text;
|
||||
PUB.XBE.Open();
|
||||
}
|
||||
}
|
||||
|
||||
private void fXbeeSetting_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
PUB.logxbee.RaiseMsg -= Log_RaiseMsgcal;
|
||||
}
|
||||
|
||||
private void btpand_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmds = new string[] {
|
||||
"+++",
|
||||
$"ATID{tbpanid.Text}\r" ,
|
||||
$"ATCN"};
|
||||
|
||||
}
|
||||
|
||||
private void btch_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmds = new string[] {
|
||||
"+++",
|
||||
$"ATCH{tbch.Text}\r" ,
|
||||
$"ATCN"};
|
||||
}
|
||||
|
||||
private void btmy_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmds = new string[] {
|
||||
"+++",
|
||||
$"ATMY{tbmy.Text}\r" ,
|
||||
$"ATCN"};
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
//read all(id,ch,my)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Cs_HMI/Project/Dialog/fXbeeSetting.resx
Normal file
120
Cs_HMI/Project/Dialog/fXbeeSetting.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user