Added duplicate tile
Added drag-n-drop files on til Added add tile on middle-click
This commit is contained in:
parent
39f54d5bba
commit
1c291c1b91
44
MainForm.Designer.cs
generated
44
MainForm.Designer.cs
generated
@ -78,10 +78,16 @@ namespace RokettoLaunch
|
||||
removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
panel1 = new System.Windows.Forms.Panel();
|
||||
tileMenu1 = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
contextMenuStrip2.SuspendLayout();
|
||||
menuStrip1.SuspendLayout();
|
||||
tileContainerMenu1.SuspendLayout();
|
||||
panel1.SuspendLayout();
|
||||
tileMenu1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// saveFileDialog1
|
||||
@ -410,6 +416,38 @@ namespace RokettoLaunch
|
||||
panel1.Size = new System.Drawing.Size(404, 417);
|
||||
panel1.TabIndex = 9;
|
||||
//
|
||||
// tileMenu1
|
||||
//
|
||||
tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
|
||||
tileMenu1.Name = "tileMenu1";
|
||||
tileMenu1.Size = new System.Drawing.Size(181, 98);
|
||||
//
|
||||
// editToolStripMenuItem1
|
||||
//
|
||||
editToolStripMenuItem1.Name = "editToolStripMenuItem1";
|
||||
editToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
||||
editToolStripMenuItem1.Text = "&Edit";
|
||||
editToolStripMenuItem1.Click += editToolStripMenuItem1_Click;
|
||||
//
|
||||
// removeToolStripMenuItem1
|
||||
//
|
||||
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
|
||||
removeToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
||||
removeToolStripMenuItem1.Text = "&Remove";
|
||||
removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click;
|
||||
//
|
||||
// toolStripMenuItem6
|
||||
//
|
||||
toolStripMenuItem6.Name = "toolStripMenuItem6";
|
||||
toolStripMenuItem6.Size = new System.Drawing.Size(180, 22);
|
||||
toolStripMenuItem6.Text = "&Duplicate";
|
||||
toolStripMenuItem6.Click += toolStripMenuItem6_Click;
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@ -431,6 +469,7 @@ namespace RokettoLaunch
|
||||
menuStrip1.PerformLayout();
|
||||
tileContainerMenu1.ResumeLayout(false);
|
||||
panel1.ResumeLayout(false);
|
||||
tileMenu1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@ -482,6 +521,11 @@ namespace RokettoLaunch
|
||||
private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
|
||||
private System.Windows.Forms.ContextMenuStrip tileMenu1;
|
||||
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
}
|
||||
}
|
||||
|
||||
|
144
MainForm.cs
144
MainForm.cs
@ -5,10 +5,12 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
using RokettoLaunch.Models;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
using RyzStudio.Windows.TileForms;
|
||||
using static RyzStudio.Windows.ThemedForms.ButtonTextBox.ThKeyCodeTextBox;
|
||||
|
||||
namespace RokettoLaunch
|
||||
{
|
||||
@ -156,6 +158,41 @@ namespace RokettoLaunch
|
||||
alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false;
|
||||
}
|
||||
|
||||
private void tileContainer_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button != MouseButtons.Middle)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var control = (sender as Control);
|
||||
if (control == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var container = UIControl.GetParentsUntil<TileContainer>(sender as Control);
|
||||
if (container == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newCoord = container.GetNextCoord();
|
||||
|
||||
var tileModel = new TileModel()
|
||||
{
|
||||
Title = "New Tile",
|
||||
IsGroup = false
|
||||
};
|
||||
|
||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
newTile.ContextMenuStrip = tileMenu1;
|
||||
newTile.LoadInfo(tileModel);
|
||||
|
||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
#region Main Menu
|
||||
|
||||
@ -544,6 +581,7 @@ namespace RokettoLaunch
|
||||
var newCoord = container.GetNextCoord();
|
||||
|
||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
newTile.ContextMenuStrip = tileMenu1;
|
||||
newTile.LoadInfo(result);
|
||||
|
||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||
@ -572,6 +610,7 @@ namespace RokettoLaunch
|
||||
var newCoord = container.GetNextCoord();
|
||||
|
||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
newTile.ContextMenuStrip = tileMenu1;
|
||||
newTile.LoadInfo(result);
|
||||
|
||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||
@ -759,6 +798,99 @@ namespace RokettoLaunch
|
||||
|
||||
#endregion
|
||||
|
||||
#region Tile
|
||||
|
||||
/// <summary>
|
||||
/// Edit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void editToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
||||
if (tile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tile.ModelInfo.IsGroup)
|
||||
{
|
||||
var form = new EditTileFolderForm(tile.ModelInfo);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
tile.LoadInfo(form.Result);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
var form = new EditTileForm(tile.ModelInfo);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
tile.LoadInfo(form.Result);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Duplicate
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void toolStripMenuItem6_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
||||
if (tile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var container = UIControl.GetParentsUntil<TileContainer>(tile);
|
||||
if (container == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newCoord = container.GetNextCoord();
|
||||
|
||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
newTile.ContextMenuStrip = tileMenu1;
|
||||
newTile.LoadInfo(tile.ModelInfo);
|
||||
|
||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void removeToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
||||
if (tile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var container = UIControl.GetParentsUntil<TileContainer>(tile);
|
||||
if (container == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
container.Controls?.Remove(tile);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private async Task AddNewTileGroup()
|
||||
{
|
||||
@ -780,20 +912,24 @@ namespace RokettoLaunch
|
||||
panel.Title = model.Title;
|
||||
panel.IsOpen = model.IsExpanded;
|
||||
panel.TitleContextMenuStrip = tileContainerMenu1;
|
||||
panel.PaddingBottom = 0;
|
||||
panel.AutoSizeHeight = true;
|
||||
panel.Tag = model;
|
||||
|
||||
panel.AutoSize(model.GridSize.Width, model.GridSize.Height);
|
||||
panel.Height += 4;
|
||||
|
||||
panel.MouseClick += tileContainer_MouseClick;
|
||||
|
||||
UIControl.Add(flowLayoutPanel1, panel);
|
||||
|
||||
// Load tiles
|
||||
foreach (var item2 in model.Items ?? new List<TileModel>())
|
||||
{
|
||||
var tile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
tile.LoadInfo(item2);
|
||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||
newTile.ContextMenuStrip = tileMenu1;
|
||||
newTile.LoadInfo(item2);
|
||||
|
||||
panel.Add(tile, item2.Position.X, item2.Position.Y);
|
||||
panel.Add(newTile, item2.Position.X, item2.Position.Y);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -433,6 +433,9 @@
|
||||
<metadata name="tileContainerMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>831, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tileMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>990, 17</value>
|
||||
</metadata>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA
|
||||
|
@ -14,7 +14,7 @@
|
||||
<Copyright>Ray Lam</Copyright>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<Version>0.3.1.042</Version>
|
||||
<Version>0.3.2.017</Version>
|
||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<PackageIcon>icon-128.png</PackageIcon>
|
||||
|
41
Windows/Forms/TilePanel.Designer.cs
generated
41
Windows/Forms/TilePanel.Designer.cs
generated
@ -28,48 +28,17 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.editToolStripMenuItem,
|
||||
this.removeToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(118, 48);
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||
this.editToolStripMenuItem.Text = "&Edit";
|
||||
this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
|
||||
//
|
||||
// removeToolStripMenuItem
|
||||
//
|
||||
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||
this.removeToolStripMenuItem.Text = "&Remove";
|
||||
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
|
||||
components = new System.ComponentModel.Container();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
SuspendLayout();
|
||||
//
|
||||
// TilePanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.Name = "TilePanel";
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
Name = "TilePanel";
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
@ -19,7 +20,6 @@ namespace RokettoLaunch.Windows.Forms
|
||||
InitializeComponent();
|
||||
|
||||
this.AllowDrop = true;
|
||||
this.ContextMenuStrip = contextMenuStrip1;
|
||||
this.Font = new Font(this.Font.FontFamily, 8.25F);
|
||||
this.Size = new Size(70, 70);
|
||||
this.AutoScaleMode = AutoScaleMode.None;
|
||||
@ -49,10 +49,30 @@ namespace RokettoLaunch.Windows.Forms
|
||||
|
||||
if (this.ModelInfo.IsGroup)
|
||||
{
|
||||
this.DropFileList(fileList);
|
||||
foreach (var item in fileList ?? new string[0])
|
||||
{
|
||||
var model = GetTileModel(item);
|
||||
if (model == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
this.ModelInfo.Items.Add(model);
|
||||
}
|
||||
|
||||
InvalidateGroupMenu(this.ModelInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((fileList?.Length ?? 0) > 0)
|
||||
{
|
||||
var model = GetTileModel(fileList[0]);
|
||||
if (model != null)
|
||||
{
|
||||
LoadInfo(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
@ -96,97 +116,6 @@ namespace RokettoLaunch.Windows.Forms
|
||||
}
|
||||
|
||||
|
||||
#region Context Menu
|
||||
|
||||
/// <summary>
|
||||
/// Edit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void editToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.ModelInfo.IsGroup)
|
||||
{
|
||||
var form = new EditTileFolderForm(this.ModelInfo);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.LoadInfo(form.Result);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
var form = new EditTileForm(this.ModelInfo);
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.LoadInfo(form.Result);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.TileContainer?.Controls?.Remove(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public void DropFileList(string[] fileList)
|
||||
{
|
||||
if (fileList == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileList.Length <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(fileList[0]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TileModel model = new TileModel()
|
||||
{
|
||||
ProcessFilename = fileList[0],
|
||||
Title = Path.GetFileName(fileList[0])
|
||||
};
|
||||
|
||||
// exe
|
||||
if (Path.GetExtension(fileList[0]).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
if (File.Exists(fileList[0]))
|
||||
{
|
||||
try
|
||||
{
|
||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(fileList[0]);
|
||||
if (fvi != null)
|
||||
{
|
||||
model.Title = fvi.ProductName;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(model.Title))
|
||||
{
|
||||
model.Title = Path.GetFileNameWithoutExtension(fileList[0]);
|
||||
}
|
||||
}
|
||||
|
||||
this.ModelInfo.Items.Add(model);
|
||||
}
|
||||
|
||||
public void LoadInfo(TileModel model)
|
||||
{
|
||||
this.modelInfo = model;
|
||||
@ -208,7 +137,7 @@ namespace RokettoLaunch.Windows.Forms
|
||||
toolTip1.SetToolTip(this, this.Title);
|
||||
}
|
||||
|
||||
protected void Execute(TileModel model)
|
||||
private void Execute(TileModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
@ -231,7 +160,7 @@ namespace RokettoLaunch.Windows.Forms
|
||||
RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin);
|
||||
}
|
||||
|
||||
protected void InvalidateGroupMenu(TileModel model)
|
||||
private void InvalidateGroupMenu(TileModel model)
|
||||
{
|
||||
var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16);
|
||||
|
||||
@ -267,5 +196,46 @@ namespace RokettoLaunch.Windows.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private TileModel GetTileModel(string filename)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(filename))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
TileModel model = new TileModel()
|
||||
{
|
||||
ProcessFilename = filename,
|
||||
Title = Path.GetFileName(filename)
|
||||
};
|
||||
|
||||
// exe
|
||||
if (Path.GetExtension(filename).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
if (File.Exists(filename))
|
||||
{
|
||||
try
|
||||
{
|
||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(filename);
|
||||
if (fvi != null)
|
||||
{
|
||||
model.Title = fvi.ProductName;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(model.Title))
|
||||
{
|
||||
model.Title = Path.GetFileNameWithoutExtension(filename);
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +1,64 @@
|
||||
<root>
|
||||
<?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">
|
||||
@ -57,9 +117,6 @@
|
||||
<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>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>172, 17</value>
|
||||
</metadata>
|
||||
|
Reference in New Issue
Block a user