Commit 6f4a1e6f HZH

add iconFont

1 个父辈 a7a2d082
...@@ -494,6 +494,8 @@ ...@@ -494,6 +494,8 @@
</Compile> </Compile>
<Compile Include="Helpers\MouseHook.cs" /> <Compile Include="Helpers\MouseHook.cs" />
<Compile Include="Helpers\NativeMethods.cs" /> <Compile Include="Helpers\NativeMethods.cs" />
<Compile Include="IconFont\FontImages.cs" />
<Compile Include="IconFont\FontIcons.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
...@@ -695,6 +697,36 @@ ...@@ -695,6 +697,36 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="IconFont\ElegantIcons.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\certificate">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\certificate64">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\handinput.cupf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\handinput.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\lm_HW_PB_7000_kn.arpa.7e9.prune.1e-7.lm.fixed">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\sgim_annex.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\sgim_hz.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\sgim_py.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="IconFont\FontAwesome.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<None Include="Resources\alarm.png" /> <None Include="Resources\alarm.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -826,10 +858,30 @@ ...@@ -826,10 +858,30 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\more1.png" /> <None Include="Resources\more1.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HandInput\HandInput.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\handinput.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\HandInput64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\overlapEngine.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="HandInput\singleEngine.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>md "$(TargetDir)HandInput" <PreBuildEvent>
copy /y "$(ProjectDir)HandInput\*.*" "$(TargetDir)HandInput"</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
......
...@@ -54,7 +54,26 @@ namespace HZH_Controls ...@@ -54,7 +54,26 @@ namespace HZH_Controls
} }
return result; return result;
} }
/// <summary>
/// ASCII编码的数组转换为英文字符串
/// </summary>
/// <param name="s">字符串</param>
/// <returns>结果</returns>
public static string ToEnString(this byte[] s)
{
return ToEncodeString(s, Encoding.ASCII).Trim('\0').Trim();
}
/// <summary>
/// 数组按指定编码转换为字符串
/// </summary>
/// <param name="dealBytes">数组</param>
/// <param name="encode">编码</param>
/// <returns>结果</returns>
public static string ToEncodeString(this byte[] dealBytes, Encoding encode)
{
return encode.GetString(dealBytes);
}
#region 转换为base64字符串 #region 转换为base64字符串
/// <summary> /// <summary>
/// 功能描述:转换为base64字符串 /// 功能描述:转换为base64字符串
......
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.IO;
namespace HZH_Controls
{
/// <summary>
/// 字体图标图片,awesome字体默认加载,elegant字体在使用时延迟加载
/// 图标示例 http://www.fontawesome.com.cn/faicons/?tdsourcetag=s_pcqq_aiomsg
/// 图标示例 https://www.elegantthemes.com/blog/resources/elegant-icon-font
/// </summary>
public static class FontImages
{
private static readonly PrivateFontCollection m_fontCollection = new PrivateFontCollection();
private static readonly Dictionary<string, Font> m_fontsAwesome = new Dictionary<string, Font>();
private static readonly Dictionary<string, Font> m_fontsElegant = new Dictionary<string, Font>();
private static Dictionary<int, float> m_cacheMaxSize = new Dictionary<int, float>();
private const int MinFontSize = 8;
private const int MaxFontSize = 43;
/// <summary>
/// 构造函数
/// </summary>
static FontImages()
{
string filenameAwesome = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "IconFont\\FontAwesome.ttf");
if (!File.Exists(filenameAwesome))
{
throw new FileNotFoundException("Font file not found", filenameAwesome);
}
m_fontCollection.AddFontFile(filenameAwesome);
float size = MinFontSize;
for (int i = 0; i <= (MaxFontSize - MinFontSize) * 2; i++)
{
m_fontsAwesome.Add(size.ToString("F2"), new Font(m_fontCollection.Families[0], size, FontStyle.Regular, GraphicsUnit.Point));
size += 0.5f;
}
}
public static FontFamily FontAwesome
{
get
{
for (int i = 0; i < m_fontCollection.Families.Length; i++)
{
if (m_fontCollection.Families[i].Name == "FontAwesome")
{
return m_fontCollection.Families[i];
}
}
return m_fontCollection.Families[0];
}
}
public static FontFamily ElegantIcons
{
get
{
if (m_fontsElegant.Count <= 0)
{
lock (m_fontsElegant)
{
if (m_fontsElegant.Count <= 0)
{
string filenameElegant = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "IconFont\\ElegantIcons.ttf");
if (!File.Exists(filenameElegant))
{
throw new FileNotFoundException("Font file not found", filenameElegant);
}
m_fontCollection.AddFontFile(filenameElegant);
float size = MinFontSize;
for (int i = 0; i <= (MaxFontSize - MinFontSize) * 2; i++)
{
m_fontsElegant.Add(size.ToString("F2"), new Font(m_fontCollection.Families[0], size, FontStyle.Regular, GraphicsUnit.Point));
size += 0.5f;
}
}
}
}
for (int i = 0; i < m_fontCollection.Families.Length; i++)
{
if (m_fontCollection.Families[i].Name == "ElegantIcons")
{
return m_fontCollection.Families[i];
}
}
return m_fontCollection.Families[0];
}
}
/// <summary>
/// 获取图标
/// </summary>
/// <param name="iconText">图标名称</param>
/// <param name="imageSize">图标大小</param>
/// <param name="foreColor">前景色</param>
/// <param name="backColor">背景色</param>
/// <returns>图标</returns>
public static Icon GetIcon(FontIcons iconText, int imageSize = 32, Color? foreColor = null, Color? backColor = null)
{
Bitmap image = GetImage(iconText, imageSize, foreColor, backColor);
return image != null ? ToIcon(image, imageSize) : null;
}
/// <summary>
/// 获取图标.
/// </summary>
/// <param name="iconText">图标名称.</param>
/// <param name="imageSize">图标大小.</param>
/// <param name="foreColor">前景色</param>
/// <param name="backColor">背景色.</param>
/// <returns>Bitmap.</returns>
public static Bitmap GetImage(FontIcons iconText, int imageSize = 32, Color? foreColor = null, Color? backColor = null)
{
Dictionary<string, Font> _fs;
if (iconText.ToString().StartsWith("A_"))
_fs = m_fontsAwesome;
else
{
if (m_fontsElegant.Count <= 0)
{
lock (m_fontsElegant)
{
if (m_fontsElegant.Count <= 0)
{
string filenameElegant = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "IconFont\\ElegantIcons.ttf");
if (!File.Exists(filenameElegant))
{
throw new FileNotFoundException("Font file not found", filenameElegant);
}
m_fontCollection.AddFontFile(filenameElegant);
float size = MinFontSize;
for (int i = 0; i <= (MaxFontSize - MinFontSize) * 2; i++)
{
m_fontsElegant.Add(size.ToString("F2"), new Font(m_fontCollection.Families[0], size, FontStyle.Regular, GraphicsUnit.Point));
size += 0.5f;
}
}
}
}
_fs = m_fontsElegant;
}
if (!foreColor.HasValue)
foreColor = Color.Black;
Font imageFont = _fs[MinFontSize.ToString("F2")];
SizeF textSize = new SizeF(imageSize, imageSize);
using (Bitmap bitmap = new Bitmap(48, 48))
using (Graphics graphics = Graphics.FromImage(bitmap))
{
//float size = MaxFontSize;
float fltMaxSize = MaxFontSize;
if (m_cacheMaxSize.ContainsKey(imageSize))
{
fltMaxSize = Math.Max(MaxFontSize, m_cacheMaxSize[imageSize] + 5);
}
while (fltMaxSize >= MinFontSize)
{
Font font = _fs[fltMaxSize.ToString("F2")];
SizeF sf = GetIconSize(iconText, graphics, font);
if (sf.Width < imageSize && sf.Height < imageSize)
{
imageFont = font;
textSize = sf;
break;
}
fltMaxSize -= 0.5f;
}
if (!m_cacheMaxSize.ContainsKey(imageSize) || (m_cacheMaxSize.ContainsKey(imageSize) && m_cacheMaxSize[imageSize] < fltMaxSize))
{
m_cacheMaxSize[imageSize] = fltMaxSize;
}
}
Bitmap srcImage = new Bitmap(imageSize, imageSize);
using (Graphics graphics = Graphics.FromImage(srcImage))
{
if (backColor.HasValue && backColor.Value != Color.Empty && backColor.Value != Color.Transparent)
graphics.Clear(backColor.Value);
string s = char.ConvertFromUtf32((int)iconText);
graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
using (Brush brush2 = new SolidBrush(foreColor.Value))
{
graphics.DrawString(s, imageFont, brush2, new PointF((imageSize - textSize.Width) / 2.0f, (imageSize - textSize.Height) / 2.0f));
}
}
return srcImage;
}
private static Size GetIconSize(FontIcons iconText, Graphics graphics, Font font)
{
string text = char.ConvertFromUtf32((int)iconText);
return graphics.MeasureString(text, font).ToSize();
}
private static Icon ToIcon(Bitmap srcBitmap, int size)
{
if (srcBitmap == null)
{
throw new ArgumentNullException("srcBitmap");
}
Icon icon;
using (MemoryStream memoryStream = new MemoryStream())
{
new Bitmap(srcBitmap, new Size(size, size)).Save(memoryStream, ImageFormat.Png);
Stream stream = new MemoryStream();
BinaryWriter binaryWriter = new BinaryWriter(stream);
if (stream.Length <= 0L)
{
return null;
}
binaryWriter.Write((byte)0);
binaryWriter.Write((byte)0);
binaryWriter.Write((short)1);
binaryWriter.Write((short)1);
binaryWriter.Write((byte)size);
binaryWriter.Write((byte)size);
binaryWriter.Write((byte)0);
binaryWriter.Write((byte)0);
binaryWriter.Write((short)0);
binaryWriter.Write((short)32);
binaryWriter.Write((int)memoryStream.Length);
binaryWriter.Write(22);
binaryWriter.Write(memoryStream.ToArray());
binaryWriter.Flush();
binaryWriter.Seek(0, SeekOrigin.Begin);
icon = new Icon(stream);
stream.Dispose();
}
return icon;
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
this.button11 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button(); this.button12 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button(); this.button13 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox9.SuspendLayout(); this.groupBox9.SuspendLayout();
this.groupBox7.SuspendLayout(); this.groupBox7.SuspendLayout();
...@@ -1239,6 +1240,16 @@ ...@@ -1239,6 +1240,16 @@
this.button13.UseVisualStyleBackColor = true; this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click); this.button13.Click += new System.EventHandler(this.button13_Click);
// //
// button14
//
this.button14.Location = new System.Drawing.Point(406, 50);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(62, 23);
this.button14.TabIndex = 0;
this.button14.Text = "图标";
this.button14.UseVisualStyleBackColor = true;
this.button14.Click += new System.EventHandler(this.button14_Click);
//
// Form1 // Form1
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -1255,6 +1266,7 @@ ...@@ -1255,6 +1266,7 @@
this.Controls.Add(this.button4); this.Controls.Add(this.button4);
this.Controls.Add(this.button3); this.Controls.Add(this.button3);
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.button14);
this.Controls.Add(this.button13); this.Controls.Add(this.button13);
this.Controls.Add(this.button12); this.Controls.Add(this.button12);
this.Controls.Add(this.button11); this.Controls.Add(this.button11);
...@@ -1357,6 +1369,7 @@ ...@@ -1357,6 +1369,7 @@
private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12; private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button13; private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
} }
} }
...@@ -238,5 +238,10 @@ namespace Test ...@@ -238,5 +238,10 @@ namespace Test
new Form5().Show(); new Form5().Show();
} }
private void button14_Click(object sender, EventArgs e)
{
new Form6().Show();
}
} }
} }
namespace Test
{
partial class Form6
{
/// <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.tabControlExt1 = new HZH_Controls.Controls.TabControlExt();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.tabControlExt1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// tabControlExt1
//
this.tabControlExt1.Controls.Add(this.tabPage1);
this.tabControlExt1.Controls.Add(this.tabPage2);
this.tabControlExt1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControlExt1.IsShowCloseBtn = false;
this.tabControlExt1.ItemSize = new System.Drawing.Size(0, 50);
this.tabControlExt1.Location = new System.Drawing.Point(0, 0);
this.tabControlExt1.Name = "tabControlExt1";
this.tabControlExt1.SelectedIndex = 0;
this.tabControlExt1.Size = new System.Drawing.Size(964, 662);
this.tabControlExt1.TabIndex = 0;
this.tabControlExt1.SelectedIndexChanged += new System.EventHandler(this.tabControlExt1_SelectedIndexChanged);
//
// tabPage1
//
this.tabPage1.AutoScroll = true;
this.tabPage1.Controls.Add(this.flowLayoutPanel1);
this.tabPage1.Location = new System.Drawing.Point(4, 54);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(956, 604);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Awesome";
this.tabPage1.UseVisualStyleBackColor = true;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoScroll = true;
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(950, 598);
this.flowLayoutPanel1.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.AutoScroll = true;
this.tabPage2.Controls.Add(this.flowLayoutPanel2);
this.tabPage2.Location = new System.Drawing.Point(4, 54);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1192, 604);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Elegant";
this.tabPage2.UseVisualStyleBackColor = true;
//
// flowLayoutPanel2
//
this.flowLayoutPanel2.AutoScroll = true;
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(1186, 598);
this.flowLayoutPanel2.TabIndex = 1;
//
// Form6
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(964, 662);
this.Controls.Add(this.tabControlExt1);
this.Name = "Form6";
this.Text = "双击可以复制指定的图标名称";
this.Load += new System.EventHandler(this.Form6_Load);
this.tabControlExt1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.TabControlExt tabControlExt1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
}
}
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void Form6_Load(object sender, EventArgs e)
{
try
{
HZH_Controls.ControlHelper.FreezeControl(this, true);
string[] nameList = System.Enum.GetNames(typeof(HZH_Controls.FontIcons));
var lst = nameList.ToList();
lst.Sort();
foreach (var item in lst)
{
HZH_Controls.FontIcons icon = (HZH_Controls.FontIcons)Enum.Parse(typeof(HZH_Controls.FontIcons), item);
Label lbl = new Label();
lbl.AutoSize = false;
lbl.Size = new System.Drawing.Size(300, 35);
lbl.ForeColor = Color.FromArgb(255, 77, 59);
lbl.TextAlign = ContentAlignment.MiddleLeft;
lbl.Margin = new System.Windows.Forms.Padding(5);
lbl.DoubleClick += lbl_DoubleClick;
string s = char.ConvertFromUtf32((int)icon);
lbl.Text = " " + item;
lbl.Image = HZH_Controls.FontImages.GetImage(icon, 32, Color.FromArgb(255, 77, 59));
lbl.ImageAlign = ContentAlignment.MiddleLeft;
lbl.Font = new Font("微软雅黑", 12);
if (item.StartsWith("A_"))
{
//lbl.Font = new System.Drawing.Font(HZH_Controls.FontImages.FontAwesome, 15);
flowLayoutPanel1.Controls.Add(lbl);
}
else
{
//lbl.Font = new System.Drawing.Font(HZH_Controls.FontImages.ElegantIcons, 15);
flowLayoutPanel2.Controls.Add(lbl);
}
}
this.ActiveControl = this.flowLayoutPanel1;
}
finally
{
HZH_Controls.ControlHelper.FreezeControl(this, false);
}
}
void lbl_DoubleClick(object sender, EventArgs e)
{
Label lbl = sender as Label;
string text = System.Text.RegularExpressions.Regex.Split(lbl.Text, "\\s+")[1];
Clipboard.SetDataObject(text);
HZH_Controls.Forms.FrmTips.ShowTipsSuccess(this, "已复制 " + text);
}
private void tabControlExt1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControlExt1.SelectedIndex == 0)
this.ActiveControl = this.flowLayoutPanel1;
else
this.ActiveControl = this.flowLayoutPanel2;
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
...@@ -74,6 +74,12 @@ ...@@ -74,6 +74,12 @@
<Compile Include="Form5.Designer.cs"> <Compile Include="Form5.Designer.cs">
<DependentUpon>Form5.cs</DependentUpon> <DependentUpon>Form5.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Form6.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form6.Designer.cs">
<DependentUpon>Form6.cs</DependentUpon>
</Compile>
<Compile Include="FrmOKCancel1Test.cs"> <Compile Include="FrmOKCancel1Test.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -121,6 +127,9 @@ ...@@ -121,6 +127,9 @@
<EmbeddedResource Include="Form5.resx"> <EmbeddedResource Include="Form5.resx">
<DependentUpon>Form5.cs</DependentUpon> <DependentUpon>Form5.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Form6.resx">
<DependentUpon>Form6.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmOKCancel1Test.resx"> <EmbeddedResource Include="FrmOKCancel1Test.resx">
<DependentUpon>FrmOKCancel1Test.cs</DependentUpon> <DependentUpon>FrmOKCancel1Test.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!