FrmWorkLog: Allow merging of WorkLogItems while importing
This commit is contained in:
@@ -8,5 +8,10 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
public DateTime DateEnd { get; set; }
|
||||
public string Activity { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public bool Overlaps(WorkLogItem other)
|
||||
{
|
||||
return (other.DateEnd < this.DateStart || other.DateStart > this.DateEnd) == false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
71
VAR.Toolbox/UI/Tools/WorkLog/FrmWorkLog.Designer.cs
generated
71
VAR.Toolbox/UI/Tools/WorkLog/FrmWorkLog.Designer.cs
generated
@@ -28,7 +28,10 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.splitWindow = new VAR.Toolbox.Controls.CSplitContainer();
|
||||
this.chkImportMerging = new System.Windows.Forms.CheckBox();
|
||||
this.btnSumary = new VAR.Toolbox.Controls.CButton();
|
||||
this.lblWorkLogTime = new System.Windows.Forms.Label();
|
||||
this.btnExport = new VAR.Toolbox.Controls.CButton();
|
||||
this.btnImport = new VAR.Toolbox.Controls.CButton();
|
||||
@@ -50,7 +53,7 @@
|
||||
this.txtActivity = new VAR.Toolbox.Controls.TextBoxNormal();
|
||||
this.btnDelete = new VAR.Toolbox.Controls.CButton();
|
||||
this.btnAdd = new VAR.Toolbox.Controls.CButton();
|
||||
this.btnSumary = new VAR.Toolbox.Controls.CButton();
|
||||
this.ttPanel = new System.Windows.Forms.ToolTip(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitWindow)).BeginInit();
|
||||
this.splitWindow.Panel1.SuspendLayout();
|
||||
this.splitWindow.Panel2.SuspendLayout();
|
||||
@@ -59,12 +62,15 @@
|
||||
//
|
||||
// splitWindow
|
||||
//
|
||||
this.splitWindow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
|
||||
this.splitWindow.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitWindow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.splitWindow.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitWindow.Name = "splitWindow";
|
||||
//
|
||||
// splitWindow.Panel1
|
||||
//
|
||||
this.splitWindow.Panel1.Controls.Add(this.chkImportMerging);
|
||||
this.splitWindow.Panel1.Controls.Add(this.btnSumary);
|
||||
this.splitWindow.Panel1.Controls.Add(this.lblWorkLogTime);
|
||||
this.splitWindow.Panel1.Controls.Add(this.btnExport);
|
||||
@@ -94,6 +100,25 @@
|
||||
this.splitWindow.SplitterDistance = 442;
|
||||
this.splitWindow.TabIndex = 0;
|
||||
//
|
||||
// chkImportMerging
|
||||
//
|
||||
this.chkImportMerging.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkImportMerging.AutoSize = true;
|
||||
this.chkImportMerging.Location = new System.Drawing.Point(391, 9);
|
||||
this.chkImportMerging.Name = "chkImportMerging";
|
||||
this.chkImportMerging.Size = new System.Drawing.Size(15, 14);
|
||||
this.chkImportMerging.TabIndex = 11;
|
||||
this.chkImportMerging.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSumary
|
||||
//
|
||||
this.btnSumary.Location = new System.Drawing.Point(194, 34);
|
||||
this.btnSumary.Name = "btnSumary";
|
||||
this.btnSumary.Size = new System.Drawing.Size(73, 23);
|
||||
this.btnSumary.TabIndex = 10;
|
||||
this.btnSumary.Text = "Sumary";
|
||||
this.btnSumary.Click += new System.EventHandler(this.btnSumary_Click);
|
||||
//
|
||||
// lblWorkLogTime
|
||||
//
|
||||
this.lblWorkLogTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
@@ -108,9 +133,9 @@
|
||||
// btnExport
|
||||
//
|
||||
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnExport.Location = new System.Drawing.Point(399, 5);
|
||||
this.btnExport.Location = new System.Drawing.Point(412, 5);
|
||||
this.btnExport.Name = "btnExport";
|
||||
this.btnExport.Size = new System.Drawing.Size(40, 21);
|
||||
this.btnExport.Size = new System.Drawing.Size(27, 21);
|
||||
this.btnExport.TabIndex = 8;
|
||||
this.btnExport.Text = "Exp";
|
||||
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
|
||||
@@ -120,7 +145,7 @@
|
||||
this.btnImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnImport.Location = new System.Drawing.Point(353, 5);
|
||||
this.btnImport.Name = "btnImport";
|
||||
this.btnImport.Size = new System.Drawing.Size(40, 21);
|
||||
this.btnImport.Size = new System.Drawing.Size(35, 21);
|
||||
this.btnImport.TabIndex = 7;
|
||||
this.btnImport.Text = "Imp";
|
||||
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
|
||||
@@ -128,7 +153,10 @@
|
||||
// cboImporters
|
||||
//
|
||||
this.cboImporters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cboImporters.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
|
||||
this.cboImporters.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboImporters.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.cboImporters.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.cboImporters.FormattingEnabled = true;
|
||||
this.cboImporters.Location = new System.Drawing.Point(258, 5);
|
||||
this.cboImporters.Name = "cboImporters";
|
||||
@@ -137,6 +165,10 @@
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
|
||||
this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||
this.txtName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.txtName.ImeMode = System.Windows.Forms.ImeMode.Disable;
|
||||
this.txtName.Location = new System.Drawing.Point(3, 7);
|
||||
this.txtName.Name = "txtName";
|
||||
@@ -182,7 +214,9 @@
|
||||
//
|
||||
// dtToday
|
||||
//
|
||||
this.dtToday.BackColor = System.Drawing.Color.DarkSlateGray;
|
||||
this.dtToday.CustomFormat = "yyyy-MM-dd";
|
||||
this.dtToday.ForeColor = System.Drawing.Color.Gray;
|
||||
this.dtToday.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtToday.Location = new System.Drawing.Point(42, 33);
|
||||
this.dtToday.Name = "dtToday";
|
||||
@@ -195,7 +229,12 @@
|
||||
this.lsbWorkLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lsbWorkLog.BackColor = System.Drawing.Color.Black;
|
||||
this.lsbWorkLog.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.lsbWorkLog.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
|
||||
this.lsbWorkLog.Font = new System.Drawing.Font("Consolas", 9F);
|
||||
this.lsbWorkLog.ForeColor = System.Drawing.Color.Gray;
|
||||
this.lsbWorkLog.FormattingEnabled = true;
|
||||
this.lsbWorkLog.ItemHeight = 12;
|
||||
this.lsbWorkLog.Location = new System.Drawing.Point(3, 60);
|
||||
this.lsbWorkLog.Name = "lsbWorkLog";
|
||||
@@ -249,7 +288,9 @@
|
||||
//
|
||||
// dtEnd
|
||||
//
|
||||
this.dtEnd.BackColor = System.Drawing.Color.DarkSlateGray;
|
||||
this.dtEnd.CustomFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
this.dtEnd.ForeColor = System.Drawing.Color.Gray;
|
||||
this.dtEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtEnd.Location = new System.Drawing.Point(4, 60);
|
||||
this.dtEnd.Name = "dtEnd";
|
||||
@@ -260,7 +301,9 @@
|
||||
//
|
||||
// dtStart
|
||||
//
|
||||
this.dtStart.BackColor = System.Drawing.Color.DarkSlateGray;
|
||||
this.dtStart.CustomFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
this.dtStart.ForeColor = System.Drawing.Color.Gray;
|
||||
this.dtStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtStart.Location = new System.Drawing.Point(4, 33);
|
||||
this.dtStart.Name = "dtStart";
|
||||
@@ -274,6 +317,10 @@
|
||||
this.txtDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtDescription.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
|
||||
this.txtDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||
this.txtDescription.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.txtDescription.Location = new System.Drawing.Point(4, 147);
|
||||
this.txtDescription.Multiline = true;
|
||||
this.txtDescription.Name = "txtDescription";
|
||||
@@ -286,6 +333,10 @@
|
||||
//
|
||||
this.txtActivity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtActivity.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
|
||||
this.txtActivity.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtActivity.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
|
||||
this.txtActivity.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
|
||||
this.txtActivity.Location = new System.Drawing.Point(3, 93);
|
||||
this.txtActivity.Name = "txtActivity";
|
||||
this.txtActivity.Size = new System.Drawing.Size(260, 20);
|
||||
@@ -310,19 +361,11 @@
|
||||
this.btnAdd.Text = "Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnSumary
|
||||
//
|
||||
this.btnSumary.Location = new System.Drawing.Point(194, 34);
|
||||
this.btnSumary.Name = "btnSumary";
|
||||
this.btnSumary.Size = new System.Drawing.Size(73, 23);
|
||||
this.btnSumary.TabIndex = 10;
|
||||
this.btnSumary.Text = "Sumary";
|
||||
this.btnSumary.Click += new System.EventHandler(this.btnSumary_Click);
|
||||
//
|
||||
// FrmWorkLog
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(721, 603);
|
||||
this.Controls.Add(this.splitWindow);
|
||||
this.Location = new System.Drawing.Point(0, 0);
|
||||
this.Name = "FrmWorkLog";
|
||||
this.Text = "WorkLog";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmWorkLog_FormClosing);
|
||||
@@ -361,5 +404,7 @@
|
||||
private VAR.Toolbox.Controls.CButton btnStats;
|
||||
private VAR.Toolbox.Controls.CButton btnSearch;
|
||||
private VAR.Toolbox.Controls.CButton btnSumary;
|
||||
private System.Windows.Forms.CheckBox chkImportMerging;
|
||||
private System.Windows.Forms.ToolTip ttPanel;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,8 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
|
||||
WorkLog_LoadData();
|
||||
|
||||
cboImporters.Items.AddRange(WorkLogImporterFactory.GetNames());
|
||||
|
||||
ttPanel.SetToolTip(chkImportMerging, "ImportMerging");
|
||||
}
|
||||
|
||||
private void FrmWorkLog_FormClosing(object sender, FormClosingEventArgs e)
|
||||
@@ -73,14 +75,20 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
|
||||
if (cboImporters.SelectedItem == null) { return; }
|
||||
IWorkLogImporter workLogImporter = WorkLogImporterFactory.CreateFromName(cboImporters.SelectedItem as string);
|
||||
List<WorkLogItem> newWorkLog = workLogImporter.Import(this);
|
||||
if (newWorkLog != null)
|
||||
if (newWorkLog == null) { return; }
|
||||
|
||||
if (chkImportMerging.Checked)
|
||||
{
|
||||
_workLog = WorkLogItemList_Merge(_workLog, newWorkLog);
|
||||
}
|
||||
else
|
||||
{
|
||||
_workLog = newWorkLog;
|
||||
}
|
||||
WorkLog_Refresh();
|
||||
MessageBox.Show("OK");
|
||||
WorkLog_MarkDirty();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log(ex);
|
||||
@@ -484,6 +492,27 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
|
||||
lblWorkLogTime.Text = tsTotalTime.ToString();
|
||||
}
|
||||
|
||||
private static List<WorkLogItem> WorkLogItemList_Merge(List<WorkLogItem> workLogA, List<WorkLogItem> workLogB)
|
||||
{
|
||||
List<WorkLogItem> newWorkLog = new List<WorkLogItem>();
|
||||
|
||||
// Add non-overlaping from A
|
||||
foreach (WorkLogItem itemA in workLogA)
|
||||
{
|
||||
if (workLogB.Any(itemB => itemB.Overlaps(itemA))) { continue; }
|
||||
|
||||
newWorkLog.Add(itemA);
|
||||
}
|
||||
|
||||
// All all from B
|
||||
foreach (WorkLogItem itemB in workLogB)
|
||||
{
|
||||
newWorkLog.Add(itemB);
|
||||
}
|
||||
|
||||
return newWorkLog;
|
||||
}
|
||||
|
||||
#endregion Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -279,14 +279,6 @@
|
||||
<Content Include="Images\toolbox.svg" />
|
||||
<Content Include="Toolbox.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="UI\Tools\FrmTestWebService.resx">
|
||||
<DependentUpon>FrmTestWebService.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Tools\WorkLog\FrmWorkLogSumary.resx">
|
||||
<DependentUpon>FrmWorkLogSumary.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</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.
|
||||
|
||||
Reference in New Issue
Block a user