Commit 2abe825f authored by JoyJ's avatar JoyJ

More code formats; Now use label as tooltip.

parent bc0829bf
...@@ -51,15 +51,15 @@ void InitForm() ...@@ -51,15 +51,15 @@ void InitForm()
this.tooltipDic = new SortedList<string, string>(); this.tooltipDic = new SortedList<string, string>();
this.InitializeComponent(); this.InitializeComponent();
//设置字体,大小 //设置字体,大小
string fontname = MyConfig.readString(MyConfig.TAG_FONT_NAME); string fontname = MyConfig.ReadString(MyConfig.TAG_FONT_NAME);
float fontsize = MyConfig.readFloat(MyConfig.TAG_FONT_SIZE, this.fctb.Font.Size); float fontsize = MyConfig.ReadFloat(MyConfig.TAG_FONT_SIZE, this.fctb.Font.Size);
this.fctb.Font = new Font(fontname, fontsize); this.fctb.Font = new Font(fontname, fontsize);
if (MyConfig.readBoolean(MyConfig.TAG_IME)) if (MyConfig.ReadBoolean(MyConfig.TAG_IME))
{ {
this.fctb.ImeMode = ImeMode.On; this.fctb.ImeMode = ImeMode.On;
} }
if (MyConfig.readBoolean(MyConfig.TAG_WORDWRAP)) if (MyConfig.ReadBoolean(MyConfig.TAG_WORDWRAP))
{ {
this.fctb.WordWrap = true; this.fctb.WordWrap = true;
} }
...@@ -68,7 +68,7 @@ void InitForm() ...@@ -68,7 +68,7 @@ void InitForm()
this.fctb.WordWrap = false; this.fctb.WordWrap = false;
} }
if (MyConfig.readBoolean(MyConfig.TAG_TAB2SPACES)) if (MyConfig.ReadBoolean(MyConfig.TAG_TAB2SPACES))
{ {
this.tabisspaces = true; this.tabisspaces = true;
} }
...@@ -370,7 +370,7 @@ void AboutToolStripMenuItemClick(object sender, EventArgs e) ...@@ -370,7 +370,7 @@ void AboutToolStripMenuItemClick(object sender, EventArgs e)
MyMsg.Show( MyMsg.Show(
LanguageHelper.GetMsg(LMSG.About) + "\t" + Application.ProductName + "\n" LanguageHelper.GetMsg(LMSG.About) + "\t" + Application.ProductName + "\n"
+ LanguageHelper.GetMsg(LMSG.Version) + "\t1.1.0.0\n" + LanguageHelper.GetMsg(LMSG.Version) + "\t1.1.0.0\n"
+ LanguageHelper.GetMsg(LMSG.Author) + "\t菜菜"); + LanguageHelper.GetMsg(LMSG.Author) + "\tNanahira & JoyJ");
} }
void Menuitem_openClick(object sender, EventArgs e) void Menuitem_openClick(object sender, EventArgs e)
......
...@@ -16,7 +16,7 @@ public class ConfHelper ...@@ -16,7 +16,7 @@ public class ConfHelper
/// </summary> /// </summary>
/// <param name="line"></param> /// <param name="line"></param>
/// <returns></returns> /// <returns></returns>
public static string getValue(string line) public static string GetValue(string line)
{ {
int t = line.IndexOf('='); int t = line.IndexOf('=');
if (t > 0) if (t > 0)
...@@ -31,7 +31,7 @@ public static string getValue(string line) ...@@ -31,7 +31,7 @@ public static string getValue(string line)
/// </summary> /// </summary>
/// <param name="word"></param> /// <param name="word"></param>
/// <returns></returns> /// <returns></returns>
public static string getValue1(string word) public static string GetValue1(string word)
{ {
int i = word.IndexOf(SEP_LINE); int i = word.IndexOf(SEP_LINE);
if (i > 0) if (i > 0)
...@@ -46,7 +46,7 @@ public static string getValue1(string word) ...@@ -46,7 +46,7 @@ public static string getValue1(string word)
/// </summary> /// </summary>
/// <param name="word"></param> /// <param name="word"></param>
/// <returns></returns> /// <returns></returns>
public static string getValue2(string word) public static string GetValue2(string word)
{ {
int i = word.IndexOf(SEP_LINE); int i = word.IndexOf(SEP_LINE);
if (i > 0) if (i > 0)
...@@ -61,16 +61,16 @@ public static string getValue2(string word) ...@@ -61,16 +61,16 @@ public static string getValue2(string word)
/// </summary> /// </summary>
/// <param name="line"></param> /// <param name="line"></param>
/// <returns></returns> /// <returns></returns>
public static string getMultLineValue(string line) public static string GetMultLineValue(string line)
{ {
return getRegex(getValue(line)); return GetRegex(GetValue(line));
} }
/// <summary> /// <summary>
/// 替换特殊符 /// 替换特殊符
/// </summary> /// </summary>
/// <param name="word"></param> /// <param name="word"></param>
/// <returns></returns> /// <returns></returns>
public static string getRegex(string word) public static string GetRegex(string word)
{ {
StringBuilder sb = new StringBuilder(word); StringBuilder sb = new StringBuilder(word);
sb.Replace("\\r", "\r"); sb.Replace("\\r", "\r");
...@@ -84,9 +84,9 @@ public static string getRegex(string word) ...@@ -84,9 +84,9 @@ public static string getRegex(string word)
/// </summary> /// </summary>
/// <param name="line"></param> /// <param name="line"></param>
/// <returns></returns> /// <returns></returns>
public static bool getBooleanValue(string line) public static bool GetBooleanValue(string line)
{ {
if (getValue(line).ToLower() == "true") if (GetValue(line).ToLower() == "true")
{ {
return true; return true;
} }
...@@ -101,12 +101,12 @@ public static bool getBooleanValue(string line) ...@@ -101,12 +101,12 @@ public static bool getBooleanValue(string line)
/// <param name="line"></param> /// <param name="line"></param>
/// <param name="defalut">失败的值</param> /// <param name="defalut">失败的值</param>
/// <returns></returns> /// <returns></returns>
public static int getIntegerValue(string line, int defalut) public static int GetIntegerValue(string line, int defalut)
{ {
int i; int i;
try try
{ {
i = int.Parse(getValue(line)); i = int.Parse(GetValue(line));
return i; return i;
} }
catch{} catch{}
......
...@@ -14,7 +14,7 @@ namespace DataEditorX.Common ...@@ -14,7 +14,7 @@ namespace DataEditorX.Common
/// </summary> /// </summary>
public static class MyBitmap public static class MyBitmap
{ {
public static Bitmap readImage(string file) public static Bitmap ReadImage(string file)
{ {
if (!File.Exists(file)) if (!File.Exists(file))
{ {
......
...@@ -110,7 +110,7 @@ public static string CheckDir(string dir,string defalut) ...@@ -110,7 +110,7 @@ public static string CheckDir(string dir,string defalut)
/// <param name="tag">前面</param> /// <param name="tag">前面</param>
/// <param name="lang"></param> /// <param name="lang"></param>
/// <returns></returns> /// <returns></returns>
public static string getFileName(string tag,string lang) public static string GetFileName(string tag,string lang)
{ {
return tag + "_" + lang + ".txt"; return tag + "_" + lang + ".txt";
} }
...@@ -120,7 +120,7 @@ public static string getFileName(string tag,string lang) ...@@ -120,7 +120,7 @@ public static string getFileName(string tag,string lang)
/// <param name="tag"></param> /// <param name="tag"></param>
/// <param name="file"></param> /// <param name="file"></param>
/// <returns></returns> /// <returns></returns>
public static string getFullFileName(string tag, string file) public static string GetFullFileName(string tag, string file)
{ {
string name = Path.GetFileNameWithoutExtension(file); string name = Path.GetFileNameWithoutExtension(file);
if (!name.StartsWith(tag + "_")) if (!name.StartsWith(tag + "_"))
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ static string reReturn(string content) ...@@ -36,7 +36,7 @@ static string reReturn(string content)
text = text.Replace("\r", "\n"); text = text.Replace("\r", "\n");
return text; return text;
} }
public static string subString(string content, string tag) public static string SubString(string content, string tag)
{ {
Regex reg = new Regex(string.Format(@"{0}{1}\n([\S\s]*?)\n{2}", TAG_START, tag, TAG_END), RegexOptions.Multiline); Regex reg = new Regex(string.Format(@"{0}{1}\n([\S\s]*?)\n{2}", TAG_START, tag, TAG_END), RegexOptions.Multiline);
Match mac = reg.Match(reReturn(content)); Match mac = reg.Match(reReturn(content));
...@@ -57,7 +57,7 @@ public static string subString(string content, string tag) ...@@ -57,7 +57,7 @@ public static string subString(string content, string tag)
/// <returns></returns> /// <returns></returns>
public static Dictionary<long, string> Read(string content, string tag) public static Dictionary<long, string> Read(string content, string tag)
{ {
return Read(subString(content,tag)); return Read(SubString(content,tag));
} }
/// <summary> /// <summary>
/// 从文件读取内容,按行读取 /// 从文件读取内容,按行读取
......
...@@ -23,20 +23,20 @@ public class ImageSet ...@@ -23,20 +23,20 @@ public class ImageSet
//初始化 //初始化
void Init() void Init()
{ {
this.normalArea = MyConfig.readArea(MyConfig.TAG_IMAGE_OTHER); this.normalArea = MyConfig.ReadArea(MyConfig.TAG_IMAGE_OTHER);
this.xyzArea = MyConfig.readArea(MyConfig.TAG_IMAGE_XYZ); this.xyzArea = MyConfig.ReadArea(MyConfig.TAG_IMAGE_XYZ);
this.pendulumArea = MyConfig.readArea(MyConfig.TAG_IMAGE_PENDULUM); this.pendulumArea = MyConfig.ReadArea(MyConfig.TAG_IMAGE_PENDULUM);
int[] ints = MyConfig.readIntegers(MyConfig.TAG_IMAGE_SIZE, 4); int[] ints = MyConfig.ReadIntegers(MyConfig.TAG_IMAGE_SIZE, 4);
this.w = ints[0]; this.w = ints[0];
this.h = ints[1]; this.h = ints[1];
this.W = ints[2]; this.W = ints[2];
this.H = ints[3]; this.H = ints[3];
this.quilty = MyConfig.readInteger(MyConfig.TAG_IMAGE_QUILTY, 95); this.quilty = MyConfig.ReadInteger(MyConfig.TAG_IMAGE_QUILTY, 95);
} }
/// <summary> /// <summary>
/// jpeg质量 /// jpeg质量
......
...@@ -181,7 +181,7 @@ public class MyConfig : XMLReader ...@@ -181,7 +181,7 @@ public class MyConfig : XMLReader
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static string readString(string key) public static string ReadString(string key)
{ {
return GetAppConfig(key); return GetAppConfig(key);
} }
...@@ -191,9 +191,9 @@ public static string readString(string key) ...@@ -191,9 +191,9 @@ public static string readString(string key)
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="def"></param> /// <param name="def"></param>
/// <returns></returns> /// <returns></returns>
public static int readInteger(string key, int def) public static int ReadInteger(string key, int def)
{ {
if (int.TryParse(readString(key), out int i)) if (int.TryParse(ReadString(key), out int i))
{ {
return i; return i;
} }
...@@ -206,9 +206,9 @@ public static int readInteger(string key, int def) ...@@ -206,9 +206,9 @@ public static int readInteger(string key, int def)
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="def"></param> /// <param name="def"></param>
/// <returns></returns> /// <returns></returns>
public static float readFloat(string key, float def) public static float ReadFloat(string key, float def)
{ {
if (float.TryParse(readString(key), out float i)) if (float.TryParse(ReadString(key), out float i))
{ {
return i; return i;
} }
...@@ -221,9 +221,9 @@ public static float readFloat(string key, float def) ...@@ -221,9 +221,9 @@ public static float readFloat(string key, float def)
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="length"></param> /// <param name="length"></param>
/// <returns></returns> /// <returns></returns>
public static int[] readIntegers(string key, int length) public static int[] ReadIntegers(string key, int length)
{ {
string temp = readString(key); string temp = ReadString(key);
int[] ints = new int[length]; int[] ints = new int[length];
string[] ws = string.IsNullOrEmpty(temp) ? null : temp.Split(','); string[] ws = string.IsNullOrEmpty(temp) ? null : temp.Split(',');
...@@ -241,9 +241,9 @@ public static int[] readIntegers(string key, int length) ...@@ -241,9 +241,9 @@ public static int[] readIntegers(string key, int length)
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static Area readArea(string key) public static Area ReadArea(string key)
{ {
int[] ints = readIntegers(key, 4); int[] ints = ReadIntegers(key, 4);
Area a = new Area(); Area a = new Area();
if (ints != null) if (ints != null)
{ {
...@@ -259,9 +259,9 @@ public static Area readArea(string key) ...@@ -259,9 +259,9 @@ public static Area readArea(string key)
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static bool readBoolean(string key,bool def=false) public static bool ReadBoolean(string key,bool def=false)
{ {
string val= readString(key); string val= ReadString(key);
if("true".Equals(val, StringComparison.OrdinalIgnoreCase)){ if("true".Equals(val, StringComparison.OrdinalIgnoreCase)){
return true; return true;
} }
...@@ -280,7 +280,7 @@ public static bool readBoolean(string key,bool def=false) ...@@ -280,7 +280,7 @@ public static bool readBoolean(string key,bool def=false)
/// <returns></returns> /// <returns></returns>
public static string GetLanguageFile(string path) public static string GetLanguageFile(string path)
{ {
if (readBoolean(TAG_CHECK_SYSLANG) && Directory.Exists(path)) if (ReadBoolean(TAG_CHECK_SYSLANG) && Directory.Exists(path))
{ {
Save(TAG_CHECK_SYSLANG, "false"); Save(TAG_CHECK_SYSLANG, "false");
string[] words = CultureInfo.InstalledUICulture.EnglishName.Split(' '); string[] words = CultureInfo.InstalledUICulture.EnglishName.Split(' ');
...@@ -288,7 +288,7 @@ public static string GetLanguageFile(string path) ...@@ -288,7 +288,7 @@ public static string GetLanguageFile(string path)
string[] files = Directory.GetFiles(path); string[] files = Directory.GetFiles(path);
foreach (string file in files) foreach (string file in files)
{ {
string name = MyPath.getFullFileName(MyConfig.TAG_LANGUAGE, file); string name = MyPath.GetFullFileName(MyConfig.TAG_LANGUAGE, file);
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
{ {
continue; continue;
...@@ -301,7 +301,7 @@ public static string GetLanguageFile(string path) ...@@ -301,7 +301,7 @@ public static string GetLanguageFile(string path)
} }
} }
} }
return MyPath.Combine(path, MyPath.getFileName(MyConfig.TAG_LANGUAGE, GetAppConfig(TAG_LANGUAGE))); return MyPath.Combine(path, MyPath.GetFileName(MyConfig.TAG_LANGUAGE, GetAppConfig(TAG_LANGUAGE)));
} }
/// <summary> /// <summary>
/// 卡片信息配置文件名 /// 卡片信息配置文件名
...@@ -310,7 +310,7 @@ public static string GetLanguageFile(string path) ...@@ -310,7 +310,7 @@ public static string GetLanguageFile(string path)
/// <returns></returns> /// <returns></returns>
public static string GetCardInfoFile(string path) public static string GetCardInfoFile(string path)
{ {
return MyPath.Combine(path, MyPath.getFileName(MyConfig.TAG_CARDINFO, GetAppConfig(TAG_LANGUAGE))); return MyPath.Combine(path, MyPath.GetFileName(MyConfig.TAG_CARDINFO, GetAppConfig(TAG_LANGUAGE)));
} }
/// <summary> /// <summary>
/// 发送消息打开文件 /// 发送消息打开文件
......
...@@ -10,18 +10,21 @@ ...@@ -10,18 +10,21 @@
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Windows.Forms; using System.Windows.Forms;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
namespace FastColoredTextBoxNS namespace FastColoredTextBoxNS
{ {
public class FastColoredTextBoxEx : FastColoredTextBox public class FastColoredTextBoxEx : FastColoredTextBox
{ {
Point lastMouseCoord; private Label lbTooltip;
Point lastMouseCoord;
public FastColoredTextBoxEx() : base() public FastColoredTextBoxEx() : base()
{ {
this.SyntaxHighlighter = new MySyntaxHighlighter(); this.SyntaxHighlighter = new MySyntaxHighlighter();
this.InitializeComponent();
this.ToolTipDelay = 1;
this.TextChangedDelayed += this.FctbTextChangedDelayed; this.TextChangedDelayed += this.FctbTextChangedDelayed;
} }
public new event EventHandler<ToolTipNeededEventArgs> ToolTipNeeded; public new event EventHandler<ToolTipNeededEventArgs> ToolTipNeeded;
protected override void OnMouseMove(MouseEventArgs e) protected override void OnMouseMove(MouseEventArgs e)
...@@ -61,13 +64,16 @@ protected override void OnToolTip() ...@@ -61,13 +64,16 @@ protected override void OnToolTip()
if (ea.ToolTipText != null) if (ea.ToolTipText != null)
{ {
//show tooltip lbTooltip.Text = $"{ea.ToolTipTitle}\r\n\r\n{ea.ToolTipText}";
this.ToolTip.ToolTipTitle = ea.ToolTipTitle; lbTooltip.Location = new Point(this.Size.Width - 500, this.lastMouseCoord.Y + this.CharHeight);
this.ToolTip.ToolTipIcon = ea.ToolTipIcon; //this.ToolTip.ToolTipTitle = ea.ToolTipTitle;
//this.ToolTip.ToolTipIcon = ea.ToolTipIcon;
//ToolTip.SetToolTip(this, ea.ToolTipText); //ToolTip.SetToolTip(this, ea.ToolTipText);
this.ToolTip.Show(ea.ToolTipText, this, new Point(this.lastMouseCoord.X, this.lastMouseCoord.Y + this.CharHeight)); //this.ToolTip.Show(ea.ToolTipText, this, new Point(this.lastMouseCoord.X, this.lastMouseCoord.Y + this.CharHeight));
} }
} }
//高亮当前词 //高亮当前词
void FctbTextChangedDelayed(object sender, TextChangedEventArgs e) void FctbTextChangedDelayed(object sender, TextChangedEventArgs e)
{ {
...@@ -101,5 +107,36 @@ void FctbTextChangedDelayed(object sender, TextChangedEventArgs e) ...@@ -101,5 +107,36 @@ void FctbTextChangedDelayed(object sender, TextChangedEventArgs e)
lastNonEmptyLine = i; lastNonEmptyLine = i;
} }
} }
}
private void InitializeComponent()
{
this.lbTooltip = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
this.SuspendLayout();
//
// lbTooltip
//
this.lbTooltip.AutoSize = true;
this.lbTooltip.BackColor = System.Drawing.SystemColors.Desktop;
this.lbTooltip.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbTooltip.ForeColor = System.Drawing.SystemColors.Control;
this.lbTooltip.Location = new System.Drawing.Point(221, 117);
this.lbTooltip.MaximumSize = new System.Drawing.Size(480, 0);
this.lbTooltip.Name = "lbTooltip";
this.lbTooltip.Size = new System.Drawing.Size(0, 28);
this.lbTooltip.TabIndex = 1;
//
// FastColoredTextBoxEx
//
this.AutoScrollMinSize = new System.Drawing.Size(27, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.lbTooltip);
this.Name = "FastColoredTextBoxEx";
this.Size = new System.Drawing.Size(584, 327);
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
}
} }
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
...@@ -76,9 +76,11 @@ void AddHistorys(string[] lines) ...@@ -76,9 +76,11 @@ void AddHistorys(string[] lines)
} }
public void AddHistory(string file) public void AddHistory(string file)
{ {
List<string> tmplist = new List<string>(); List<string> tmplist = new List<string>
//添加到开始 {
tmplist.Add(file); //添加到开始
file
};
//添加旧记录 //添加旧记录
tmplist.AddRange(this.cdbhistory.ToArray()); tmplist.AddRange(this.cdbhistory.ToArray());
tmplist.AddRange(this.luahistory.ToArray()); tmplist.AddRange(this.luahistory.ToArray());
......
...@@ -29,12 +29,10 @@ public CardEdit(IDataForm dataform) ...@@ -29,12 +29,10 @@ public CardEdit(IDataForm dataform)
//添加 //添加
public class AddCommand: IBackableCommand public class AddCommand: IBackableCommand
{ {
private string _undoSQL; private string undoSQL;
readonly CardEdit cardedit;
readonly IDataForm dataform; readonly IDataForm dataform;
public AddCommand(CardEdit cardedit) public AddCommand(CardEdit cardedit)
{ {
this.cardedit = cardedit;
this.dataform = cardedit.dataform; this.dataform = cardedit.dataform;
} }
...@@ -64,7 +62,7 @@ public bool Excute(params object[] args) ...@@ -64,7 +62,7 @@ public bool Excute(params object[] args)
DataBase.GetInsertSQL(c, true)) >= 2) DataBase.GetInsertSQL(c, true)) >= 2)
{ {
MyMsg.Show(LMSG.AddSucceed); MyMsg.Show(LMSG.AddSucceed);
this._undoSQL = DataBase.GetDeleteSQL(c); this.undoSQL = DataBase.GetDeleteSQL(c);
this.dataform.Search(true); this.dataform.Search(true);
this.dataform.SetCard(c); this.dataform.SetCard(c);
return true; return true;
...@@ -74,7 +72,7 @@ public bool Excute(params object[] args) ...@@ -74,7 +72,7 @@ public bool Excute(params object[] args)
} }
public void Undo() public void Undo()
{ {
DataBase.Command(this.dataform.GetOpenFile(), this._undoSQL); DataBase.Command(this.dataform.GetOpenFile(), this.undoSQL);
} }
public object Clone() public object Clone()
...@@ -88,16 +86,14 @@ public object Clone() ...@@ -88,16 +86,14 @@ public object Clone()
//修改 //修改
public class ModCommand: IBackableCommand public class ModCommand: IBackableCommand
{ {
private string _undoSQL; private string undoSQL;
private bool modifiled = false; private bool modifiled = false;
private long oldid; private long oldid;
private long newid; private long newid;
private bool delold; private bool delold;
readonly CardEdit cardedit;
readonly IDataForm dataform; readonly IDataForm dataform;
public ModCommand(CardEdit cardedit) public ModCommand(CardEdit cardedit)
{ {
this.cardedit = cardedit;
this.dataform = cardedit.dataform; this.dataform = cardedit.dataform;
} }
...@@ -138,12 +134,12 @@ public bool Excute(params object[] args) ...@@ -138,12 +134,12 @@ public bool Excute(params object[] args)
} }
else else
{//删除成功,添加还原sql {//删除成功,添加还原sql
this._undoSQL = DataBase.GetDeleteSQL(c) + DataBase.GetInsertSQL(oldCard, false); this.undoSQL = DataBase.GetDeleteSQL(c) + DataBase.GetInsertSQL(oldCard, false);
} }
} }
else else
{ {
this._undoSQL = DataBase.GetDeleteSQL(c);//还原就是删除 this.undoSQL = DataBase.GetDeleteSQL(c);//还原就是删除
} }
//如果删除旧卡片,则把资源修改名字,否则复制资源 //如果删除旧卡片,则把资源修改名字,否则复制资源
if (modfiles) if (modfiles)
...@@ -166,7 +162,7 @@ public bool Excute(params object[] args) ...@@ -166,7 +162,7 @@ public bool Excute(params object[] args)
else else
{//更新数据 {//更新数据
sql = DataBase.GetUpdateSQL(c); sql = DataBase.GetUpdateSQL(c);
this._undoSQL = DataBase.GetUpdateSQL(oldCard); this.undoSQL = DataBase.GetUpdateSQL(oldCard);
} }
if (DataBase.Command(this.dataform.GetOpenFile(), sql) > 0) if (DataBase.Command(this.dataform.GetOpenFile(), sql) > 0)
{ {
...@@ -185,7 +181,7 @@ public bool Excute(params object[] args) ...@@ -185,7 +181,7 @@ public bool Excute(params object[] args)
public void Undo() public void Undo()
{ {
DataBase.Command(this.dataform.GetOpenFile(), this._undoSQL); DataBase.Command(this.dataform.GetOpenFile(), this.undoSQL);
if (this.modifiled) if (this.modifiled)
{ {
if (this.delold) if (this.delold)
...@@ -210,12 +206,10 @@ public object Clone() ...@@ -210,12 +206,10 @@ public object Clone()
//删除 //删除
public class DelCommand : IBackableCommand public class DelCommand : IBackableCommand
{ {
private string _undoSQL; private string undoSQL;
readonly CardEdit cardedit;
readonly IDataForm dataform; readonly IDataForm dataform;
public DelCommand(CardEdit cardedit) public DelCommand(CardEdit cardedit)
{ {
this.cardedit = cardedit;
this.dataform = cardedit.dataform; this.dataform = cardedit.dataform;
} }
...@@ -255,7 +249,7 @@ public bool Excute(params object[] args) ...@@ -255,7 +249,7 @@ public bool Excute(params object[] args)
{ {
MyMsg.Show(LMSG.DeleteSucceed); MyMsg.Show(LMSG.DeleteSucceed);
this.dataform.Search(true); this.dataform.Search(true);
this._undoSQL = undo; this.undoSQL = undo;
return true; return true;
} }
else else
...@@ -267,7 +261,7 @@ public bool Excute(params object[] args) ...@@ -267,7 +261,7 @@ public bool Excute(params object[] args)
} }
public void Undo() public void Undo()
{ {
DataBase.Command(this.dataform.GetOpenFile(), this._undoSQL); DataBase.Command(this.dataform.GetOpenFile(), this.undoSQL);
} }
public object Clone() public object Clone()
...@@ -354,9 +348,9 @@ public bool OpenScript(bool openinthis, string addrequire) ...@@ -354,9 +348,9 @@ public bool OpenScript(bool openinthis, string addrequire)
public class CopyCommand : IBackableCommand public class CopyCommand : IBackableCommand
{ {
bool copied = false; bool copied = false;
Card[] NewCards; Card[] newCards;
bool replace; bool replace;
Card[] OldCards; Card[] oldCards;
readonly CardEdit cardedit; readonly CardEdit cardedit;
readonly IDataForm dataform; readonly IDataForm dataform;
public CopyCommand(CardEdit cardedit) public CopyCommand(CardEdit cardedit)
...@@ -406,15 +400,15 @@ public bool Excute(params object[] args) ...@@ -406,15 +400,15 @@ public bool Excute(params object[] args)
} }
DataBase.CopyDB(this.dataform.GetOpenFile(), !replace, cards); DataBase.CopyDB(this.dataform.GetOpenFile(), !replace, cards);
this.copied = true; this.copied = true;
this.NewCards = cards; this.newCards = cards;
this.replace = replace; this.replace = replace;
this.OldCards = oldcards; this.oldCards = oldcards;
return true; return true;
} }
public void Undo() public void Undo()
{ {
DataBase.DeleteDB(this.dataform.GetOpenFile(), this.NewCards); DataBase.DeleteDB(this.dataform.GetOpenFile(), this.newCards);
DataBase.CopyDB(this.dataform.GetOpenFile(), !this.replace, this.OldCards); DataBase.CopyDB(this.dataform.GetOpenFile(), !this.replace, this.oldCards);
} }
public object Clone() public object Clone()
...@@ -422,12 +416,12 @@ public object Clone() ...@@ -422,12 +416,12 @@ public object Clone()
CopyCommand replica = new CopyCommand(this.cardedit) CopyCommand replica = new CopyCommand(this.cardedit)
{ {
copied = this.copied, copied = this.copied,
NewCards = (Card[])this.NewCards.Clone(), newCards = (Card[])this.newCards.Clone(),
replace = this.replace replace = this.replace
}; };
if (this.OldCards != null) if (this.oldCards != null)
{ {
replica.OldCards = (Card[])this.OldCards.Clone(); replica.oldCards = (Card[])this.oldCards.Clone();
} }
return replica; return replica;
......
...@@ -30,7 +30,7 @@ public static class CardLink ...@@ -30,7 +30,7 @@ public static class CardLink
public const int Up = 0x80; public const int Up = 0x80;
public const int UpRight = 0x100; public const int UpRight = 0x100;
public static bool isLink(int marks, int mark){ public static bool IsLink(int marks, int mark){
return (marks & mark) == mark; return (marks & mark) == mark;
} }
} }
......
...@@ -17,10 +17,10 @@ public class CardPack ...@@ -17,10 +17,10 @@ public class CardPack
{ {
public CardPack(long id) public CardPack(long id)
{ {
this.card_id=id; this.CardId=id;
} }
public long card_id{ public long CardId{
get; get;
private set; private set;
} }
...@@ -29,7 +29,7 @@ public CardPack(long id) ...@@ -29,7 +29,7 @@ public CardPack(long id)
public string rarity; public string rarity;
public string date; public string date;
public string getMseRarity(){ public string GetMseRarity(){
if(this.rarity==null) if(this.rarity==null)
{ {
return "common"; return "common";
......
...@@ -63,7 +63,7 @@ public class MSEConfig ...@@ -63,7 +63,7 @@ public class MSEConfig
#endregion #endregion
public MSEConfig(string path) public MSEConfig(string path)
{ {
this.init(path); this.Init(path);
} }
public void SetConfig(string config, string path) public void SetConfig(string config, string path)
{ {
...@@ -75,7 +75,7 @@ public void SetConfig(string config, string path) ...@@ -75,7 +75,7 @@ public void SetConfig(string config, string path)
this.regx_monster = "(\\s\\S*?)"; this.regx_monster = "(\\s\\S*?)";
this.regx_pendulum = "(\\s\\S*?)"; this.regx_pendulum = "(\\s\\S*?)";
//设置文件名 //设置文件名
this.configName = MyPath.getFullFileName(MSEConfig.TAG, config); this.configName = MyPath.GetFullFileName(MSEConfig.TAG, config);
this.replaces = new SortedList<string, string>(); this.replaces = new SortedList<string, string>();
...@@ -91,56 +91,56 @@ public void SetConfig(string config, string path) ...@@ -91,56 +91,56 @@ public void SetConfig(string config, string path)
if (line.StartsWith(TAG_CN2TW)) if (line.StartsWith(TAG_CN2TW))
{ {
this.Iscn2tw = ConfHelper.getBooleanValue(line); this.Iscn2tw = ConfHelper.GetBooleanValue(line);
} }
else if (line.StartsWith(TAG_SPELL)) else if (line.StartsWith(TAG_SPELL))
{ {
this.str_spell = ConfHelper.getValue(line); this.str_spell = ConfHelper.GetValue(line);
} }
else if (line.StartsWith(TAG_HEAD)) else if (line.StartsWith(TAG_HEAD))
{ {
this.head = ConfHelper.getMultLineValue(line); this.head = ConfHelper.GetMultLineValue(line);
} }
else if (line.StartsWith(TAG_END)) else if (line.StartsWith(TAG_END))
{ {
this.end = ConfHelper.getMultLineValue(line); this.end = ConfHelper.GetMultLineValue(line);
} }
else if (line.StartsWith(TAG_TEXT)) else if (line.StartsWith(TAG_TEXT))
{ {
this.temp_text = ConfHelper.getMultLineValue(line); this.temp_text = ConfHelper.GetMultLineValue(line);
} }
else if (line.StartsWith(TAG_TRAP)) else if (line.StartsWith(TAG_TRAP))
{ {
this.str_trap = ConfHelper.getValue(line); this.str_trap = ConfHelper.GetValue(line);
} }
else if (line.StartsWith(TAG_REG_PENDULUM)) else if (line.StartsWith(TAG_REG_PENDULUM))
{ {
this.regx_pendulum = ConfHelper.getValue(line); this.regx_pendulum = ConfHelper.GetValue(line);
} }
else if (line.StartsWith(TAG_REG_MONSTER)) else if (line.StartsWith(TAG_REG_MONSTER))
{ {
this.regx_monster = ConfHelper.getValue(line); this.regx_monster = ConfHelper.GetValue(line);
} }
else if (line.StartsWith(TAG_MAXCOUNT)) else if (line.StartsWith(TAG_MAXCOUNT))
{ {
this.maxcount = ConfHelper.getIntegerValue(line, 0); this.maxcount = ConfHelper.GetIntegerValue(line, 0);
} }
else if (line.StartsWith(TAG_WIDTH)){ else if (line.StartsWith(TAG_WIDTH)){
this.width =ConfHelper.getIntegerValue(line,0); this.width =ConfHelper.GetIntegerValue(line,0);
} }
else if (line.StartsWith(TAG_HEIGHT)){ else if (line.StartsWith(TAG_HEIGHT)){
this.height =ConfHelper.getIntegerValue(line,0); this.height =ConfHelper.GetIntegerValue(line,0);
} }
else if (line.StartsWith(TAG_PEND_WIDTH)){ else if (line.StartsWith(TAG_PEND_WIDTH)){
this.pwidth =ConfHelper.getIntegerValue(line,0); this.pwidth =ConfHelper.GetIntegerValue(line,0);
} }
else if (line.StartsWith(TAG_PEND_HEIGHT)){ else if (line.StartsWith(TAG_PEND_HEIGHT)){
this.pheight =ConfHelper.getIntegerValue(line,0); this.pheight =ConfHelper.GetIntegerValue(line,0);
} }
else if(line.StartsWith(TAG_NO_TEN)){ else if(line.StartsWith(TAG_NO_TEN)){
this.no10 = ConfHelper.getBooleanValue(line); this.no10 = ConfHelper.GetBooleanValue(line);
}else if(line.StartsWith(TAG_NO_START_CARDS)){ }else if(line.StartsWith(TAG_NO_START_CARDS)){
string val = ConfHelper.getValue(line); string val = ConfHelper.GetValue(line);
string[] cs = val.Split(','); string[] cs = val.Split(',');
this.noStartCards =new long[cs.Length]; this.noStartCards =new long[cs.Length];
int i=0; int i=0;
...@@ -152,16 +152,16 @@ public void SetConfig(string config, string path) ...@@ -152,16 +152,16 @@ public void SetConfig(string config, string path)
else if (line.StartsWith(TAG_IMAGE)) else if (line.StartsWith(TAG_IMAGE))
{ {
//如果路径不合法,则为后面的路径 //如果路径不合法,则为后面的路径
this.imagepath = MyPath.CheckDir(ConfHelper.getValue(line), MyPath.Combine(path, PATH_IMAGE)); this.imagepath = MyPath.CheckDir(ConfHelper.GetValue(line), MyPath.Combine(path, PATH_IMAGE));
//图片缓存目录 //图片缓存目录
this.imagecache = MyPath.Combine(this.imagepath, "cache"); this.imagecache = MyPath.Combine(this.imagepath, "cache");
MyPath.CreateDir(this.imagecache); MyPath.CreateDir(this.imagecache);
} }
else if (line.StartsWith(TAG_REPALCE)) else if (line.StartsWith(TAG_REPALCE))
{//特数字替换 {//特数字替换
string word = ConfHelper.getValue(line); string word = ConfHelper.GetValue(line);
string p = ConfHelper.getRegex(ConfHelper.getValue1(word)); string p = ConfHelper.GetRegex(ConfHelper.GetValue1(word));
string r = ConfHelper.getRegex(ConfHelper.getValue2(word)); string r = ConfHelper.GetRegex(ConfHelper.GetValue2(word));
if (!string.IsNullOrEmpty(p)) if (!string.IsNullOrEmpty(p))
{ {
this.replaces.Add(p, r); this.replaces.Add(p, r);
...@@ -175,20 +175,20 @@ public void SetConfig(string config, string path) ...@@ -175,20 +175,20 @@ public void SetConfig(string config, string path)
{//类型 {//类型
ConfHelper.DicAdd(this.typeDic, line); ConfHelper.DicAdd(this.typeDic, line);
}else if(line.StartsWith(TAG_REIMAGE)){ }else if(line.StartsWith(TAG_REIMAGE)){
this.reimage = ConfHelper.getBooleanValue(line); this.reimage = ConfHelper.GetBooleanValue(line);
} }
} }
} }
public void init(string path) public void Init(string path)
{ {
this.Iscn2tw = false; this.Iscn2tw = false;
//读取配置 //读取配置
string tmp = MyPath.Combine(path, MyPath.getFileName(MSEConfig.TAG, MyConfig.readString(MyConfig.TAG_MSE))); string tmp = MyPath.Combine(path, MyPath.GetFileName(MSEConfig.TAG, MyConfig.ReadString(MyConfig.TAG_MSE)));
if (!File.Exists(tmp)) if (!File.Exists(tmp))
{ {
tmp = MyPath.Combine(path, MyPath.getFileName(MSEConfig.TAG, FILE_CONFIG_NAME)); tmp = MyPath.Combine(path, MyPath.GetFileName(MSEConfig.TAG, FILE_CONFIG_NAME));
if(!File.Exists(tmp)) if(!File.Exists(tmp))
{ {
return;//如果默认的也不存在 return;//如果默认的也不存在
......
...@@ -447,32 +447,32 @@ string getMonster(Card c, string img,CardPack cardpack=null,bool rarity=true) ...@@ -447,32 +447,32 @@ string getMonster(Card c, string img,CardPack cardpack=null,bool rarity=true)
if(cardpack!=null){ if(cardpack!=null){
sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id)); sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id));
if(rarity){ if(rarity){
sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.getMseRarity())); sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.GetMseRarity()));
} }
} }
if(c.IsType(CardType.TYPE_LINK)){ if(c.IsType(CardType.TYPE_LINK)){
if(CardLink.isLink(c.def, CardLink.DownLeft)){ if(CardLink.IsLink(c.def, CardLink.DownLeft)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_DL, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_DL, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.Down)){ if(CardLink.IsLink(c.def, CardLink.Down)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_Down, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_Down, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.DownRight)){ if(CardLink.IsLink(c.def, CardLink.DownRight)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_DR, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_DR, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.UpLeft)){ if(CardLink.IsLink(c.def, CardLink.UpLeft)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_UL, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_UL, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.Up)){ if(CardLink.IsLink(c.def, CardLink.Up)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_Up, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_Up, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.UpRight)){ if(CardLink.IsLink(c.def, CardLink.UpRight)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_UR, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_UR, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.Left)){ if(CardLink.IsLink(c.def, CardLink.Left)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_Left, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_Left, "yes"));
} }
if(CardLink.isLink(c.def, CardLink.Right)){ if(CardLink.IsLink(c.def, CardLink.Right)){
sb.AppendLine(this.GetLine(TAG_Link_Marker_Right, "yes")); sb.AppendLine(this.GetLine(TAG_Link_Marker_Right, "yes"));
} }
sb.AppendLine(this.GetLine(TAG_Link_Number, ""+ this.getLinkNumber(c.def))); sb.AppendLine(this.GetLine(TAG_Link_Number, ""+ this.getLinkNumber(c.def)));
...@@ -520,7 +520,7 @@ string getSpellTrap(Card c, string img, bool isSpell,CardPack cardpack=null,bool ...@@ -520,7 +520,7 @@ string getSpellTrap(Card c, string img, bool isSpell,CardPack cardpack=null,bool
if(cardpack!=null){ if(cardpack!=null){
sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id)); sb.AppendLine(this.GetLine(TAG_NUMBER, cardpack.pack_id));
if(rarity){ if(rarity){
sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.getMseRarity())); sb.AppendLine(this.GetLine(TAG_RARITY, cardpack.GetMseRarity()));
} }
} }
sb.AppendLine(" " + TAG_TEXT + ":"); sb.AppendLine(" " + TAG_TEXT + ":");
...@@ -888,7 +888,7 @@ public Card[] ReadCards(string set, bool repalceOld) ...@@ -888,7 +888,7 @@ public Card[] ReadCards(string set, bool repalceOld)
string file = MyPath.Combine(this.cfg.imagecache, md5); string file = MyPath.Combine(this.cfg.imagecache, md5);
if(!File.Exists(file)){ if(!File.Exists(file)){
//生成缓存 //生成缓存
Bitmap bmp=MyBitmap.readImage(img); Bitmap bmp=MyBitmap.ReadImage(img);
//缩放 //缩放
if(isPendulum){ if(isPendulum){
bmp=MyBitmap.Zoom(bmp, this.cfg.pwidth, this.cfg.pheight); bmp=MyBitmap.Zoom(bmp, this.cfg.pwidth, this.cfg.pheight);
......
...@@ -48,7 +48,7 @@ public override string ToString() ...@@ -48,7 +48,7 @@ public override string ToString()
} }
public class CardJson{ public class CardJson{
public static void test(){ public static void Test(){
string json = File.ReadAllText(@"F:\TCGEditor_v1.2\t.tcgb"); string json = File.ReadAllText(@"F:\TCGEditor_v1.2\t.tcgb");
CardSet cardset = JsonConvert.DeserializeObject<CardSet>(json); CardSet cardset = JsonConvert.DeserializeObject<CardSet>(json);
if(cardset.cards!=null){ if(cardset.cards!=null){
......
...@@ -136,7 +136,7 @@ public void ToImg(string img, string saveimg1) ...@@ -136,7 +136,7 @@ public void ToImg(string img, string saveimg1)
#region 检查更新 #region 检查更新
public static void CheckVersion(bool showNew) public static void CheckVersion(bool showNew)
{ {
string newver = CheckUpdate.GetNewVersion(MyConfig.readString(MyConfig.TAG_UPDATE_URL)); string newver = CheckUpdate.GetNewVersion(MyConfig.ReadString(MyConfig.TAG_UPDATE_URL));
if (newver == CheckUpdate.DEFALUT) if (newver == CheckUpdate.DEFALUT)
{ //检查失败 { //检查失败
if (!showNew) if (!showNew)
...@@ -284,8 +284,8 @@ public void SaveMSEs(string file, Card[] cards,bool isUpdate) ...@@ -284,8 +284,8 @@ public void SaveMSEs(string file, Card[] cards,bool isUpdate)
return; return;
} }
string pack_db=MyPath.GetRealPath(MyConfig.readString("pack_db")); string pack_db=MyPath.GetRealPath(MyConfig.ReadString("pack_db"));
bool rarity=MyConfig.readBoolean("mse_auto_rarity", false); bool rarity=MyConfig.ReadBoolean("mse_auto_rarity", false);
#if DEBUG #if DEBUG
MessageBox.Show("db = "+pack_db+",auto rarity="+rarity); MessageBox.Show("db = "+pack_db+",auto rarity="+rarity);
#endif #endif
......
...@@ -101,7 +101,7 @@ public DataEditForm(string datapath) ...@@ -101,7 +101,7 @@ public DataEditForm(string datapath)
} }
public DataEditForm() public DataEditForm()
{//默认启动 {//默认启动
string dir = MyConfig.readString(MyConfig.TAG_DATA); string dir = MyConfig.ReadString(MyConfig.TAG_DATA);
if (string.IsNullOrEmpty(dir)) if (string.IsNullOrEmpty(dir))
{ {
Application.Exit(); Application.Exit();
...@@ -171,13 +171,13 @@ void DataEditFormLoad(object sender, EventArgs e) ...@@ -171,13 +171,13 @@ void DataEditFormLoad(object sender, EventArgs e)
this.oldCard = new Card(0); this.oldCard = new Card(0);
this.SetCard(this.oldCard); this.SetCard(this.oldCard);
//删除资源 //删除资源
this.menuitem_operacardsfile.Checked = MyConfig.readBoolean(MyConfig.TAG_DELETE_WITH); this.menuitem_operacardsfile.Checked = MyConfig.ReadBoolean(MyConfig.TAG_DELETE_WITH);
//用CodeEditor打开脚本 //用CodeEditor打开脚本
this.menuitem_openfileinthis.Checked = MyConfig.readBoolean(MyConfig.TAG_OPEN_IN_THIS); this.menuitem_openfileinthis.Checked = MyConfig.ReadBoolean(MyConfig.TAG_OPEN_IN_THIS);
//自动检查更新 //自动检查更新
this.menuitem_autocheckupdate.Checked = MyConfig.readBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE); this.menuitem_autocheckupdate.Checked = MyConfig.ReadBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE);
//add require automatically //add require automatically
this.Addrequire = MyConfig.readString(MyConfig.TAG_ADD_REQUIRE); this.Addrequire = MyConfig.ReadString(MyConfig.TAG_ADD_REQUIRE);
this.menuitem_addrequire.Checked = (this.Addrequire.Length > 0); this.menuitem_addrequire.Checked = (this.Addrequire.Length > 0);
if (this.nowCdbFile != null && File.Exists(this.nowCdbFile)) if (this.nowCdbFile != null && File.Exists(this.nowCdbFile))
{ {
...@@ -295,7 +295,7 @@ void InitPath(string datapath) ...@@ -295,7 +295,7 @@ void InitPath(string datapath)
this.confcover = MyPath.Combine(datapath, "cover.jpg"); this.confcover = MyPath.Combine(datapath, "cover.jpg");
if (File.Exists(this.confcover)) if (File.Exists(this.confcover))
{ {
this.cover = MyBitmap.readImage(this.confcover); this.cover = MyBitmap.ReadImage(this.confcover);
} }
else else
{ {
...@@ -567,7 +567,7 @@ long GetSelect(ComboBox cb) ...@@ -567,7 +567,7 @@ long GetSelect(ComboBox cb)
} }
List<long> keys = (List<long>)cb.Tag; List<long> keys = (List<long>)cb.Tag;
int index = cb.SelectedIndex; int index = cb.SelectedIndex;
if (index >= keys.Count) if (index >= keys.Count || index < 0)
{ {
return 0; return 0;
} }
...@@ -1155,7 +1155,7 @@ void Menuitem_aboutClick(object sender, EventArgs e) ...@@ -1155,7 +1155,7 @@ void Menuitem_aboutClick(object sender, EventArgs e)
MyMsg.Show( MyMsg.Show(
LanguageHelper.GetMsg(LMSG.About) + "\t" + Application.ProductName + "\n" LanguageHelper.GetMsg(LMSG.About) + "\t" + Application.ProductName + "\n"
+ LanguageHelper.GetMsg(LMSG.Version) + "\t" + Application.ProductVersion + "\n" + LanguageHelper.GetMsg(LMSG.Version) + "\t" + Application.ProductVersion + "\n"
+ LanguageHelper.GetMsg(LMSG.Author) + "\t菜菜"); + LanguageHelper.GetMsg(LMSG.Author) + "\tNanahira & JoyJ");
} }
void Menuitem_checkupdateClick(object sender, EventArgs e) void Menuitem_checkupdateClick(object sender, EventArgs e)
...@@ -1197,7 +1197,7 @@ void Menuitem_cancelTaskClick(object sender, EventArgs e) ...@@ -1197,7 +1197,7 @@ void Menuitem_cancelTaskClick(object sender, EventArgs e)
} }
void Menuitem_githubClick(object sender, EventArgs e) void Menuitem_githubClick(object sender, EventArgs e)
{ {
System.Diagnostics.Process.Start(MyConfig.readString(MyConfig.TAG_SOURCE_URL)); System.Diagnostics.Process.Start(MyConfig.ReadString(MyConfig.TAG_SOURCE_URL));
} }
#endregion #endregion
...@@ -1630,12 +1630,12 @@ public void SetImage(long id) ...@@ -1630,12 +1630,12 @@ public void SetImage(long id)
string msepic = MseMaker.GetCardImagePath(this.tasker.MSEImagePath, this.oldCard); string msepic = MseMaker.GetCardImagePath(this.tasker.MSEImagePath, this.oldCard);
if(File.Exists(msepic)) if(File.Exists(msepic))
{ {
this.pl_image.BackgroundImage = MyBitmap.readImage(msepic); this.pl_image.BackgroundImage = MyBitmap.ReadImage(msepic);
} }
} }
else if (File.Exists(pic)) else if (File.Exists(pic))
{ {
this.pl_image.BackgroundImage = MyBitmap.readImage(pic); this.pl_image.BackgroundImage = MyBitmap.ReadImage(pic);
} }
else else
{ {
...@@ -1779,7 +1779,7 @@ void AddMenuItemFormMSE() ...@@ -1779,7 +1779,7 @@ void AddMenuItemFormMSE()
string[] files = Directory.GetFiles(this.datapath); string[] files = Directory.GetFiles(this.datapath);
foreach (string file in files) foreach (string file in files)
{ {
string name = MyPath.getFullFileName(MSEConfig.TAG, file); string name = MyPath.GetFullFileName(MSEConfig.TAG, file);
//是否是MSE配置文件 //是否是MSE配置文件
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
{ {
...@@ -1999,7 +1999,7 @@ void GetLanguageItem() ...@@ -1999,7 +1999,7 @@ void GetLanguageItem()
string[] files = Directory.GetFiles(this.datapath); string[] files = Directory.GetFiles(this.datapath);
foreach (string file in files) foreach (string file in files)
{ {
string name = MyPath.getFullFileName(MyConfig.TAG_LANGUAGE, file); string name = MyPath.GetFullFileName(MyConfig.TAG_LANGUAGE, file);
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
{ {
continue; continue;
...@@ -2011,7 +2011,7 @@ void GetLanguageItem() ...@@ -2011,7 +2011,7 @@ void GetLanguageItem()
ToolTipText = file ToolTipText = file
}; };
tsmi.Click += this.SetLanguage_Click; tsmi.Click += this.SetLanguage_Click;
if (MyConfig.readString(MyConfig.TAG_LANGUAGE).Equals(name, StringComparison.OrdinalIgnoreCase)) if (MyConfig.ReadString(MyConfig.TAG_LANGUAGE).Equals(name, StringComparison.OrdinalIgnoreCase))
{ {
tsmi.Checked = true; tsmi.Checked = true;
} }
...@@ -2043,7 +2043,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e) ...@@ -2043,7 +2043,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
return; return;
} }
string msepath=MyPath.GetRealPath(MyConfig.readString(MyConfig.TAG_MSE_PATH)); string msepath=MyPath.GetRealPath(MyConfig.ReadString(MyConfig.TAG_MSE_PATH));
if(!File.Exists(msepath)){ if(!File.Exists(msepath)){
MyMsg.Error(LMSG.exportMseImagesErr); MyMsg.Error(LMSG.exportMseImagesErr);
this.menuitem_exportMSEimage.Checked=false; this.menuitem_exportMSEimage.Checked=false;
...@@ -2065,7 +2065,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e) ...@@ -2065,7 +2065,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
{ {
string mseset=dlg.FileName; string mseset=dlg.FileName;
string exportpath=MyPath.GetRealPath(MyConfig.readString(MyConfig.TAG_MSE_EXPORT)); string exportpath=MyPath.GetRealPath(MyConfig.ReadString(MyConfig.TAG_MSE_EXPORT));
MseMaker.ExportSet(msepath, mseset, exportpath, delegate{ MseMaker.ExportSet(msepath, mseset, exportpath, delegate{
this.menuitem_exportMSEimage.Checked=false; this.menuitem_exportMSEimage.Checked=false;
}); });
...@@ -2123,7 +2123,7 @@ void Menuitem_autoreturnClick(object sender, EventArgs e) ...@@ -2123,7 +2123,7 @@ void Menuitem_autoreturnClick(object sender, EventArgs e)
if (DataBase.Create(dlg.FileName)) if (DataBase.Create(dlg.FileName))
{ {
// //
int len = MyConfig.readInteger(MyConfig.TAG_AUTO_LEN, 30); int len = MyConfig.ReadInteger(MyConfig.TAG_AUTO_LEN, 30);
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if(cards[i].desc!=null){ if(cards[i].desc!=null){
...@@ -2160,7 +2160,7 @@ void Menuitem_replaceClick(object sender, EventArgs e) ...@@ -2160,7 +2160,7 @@ void Menuitem_replaceClick(object sender, EventArgs e)
if (DataBase.Create(dlg.FileName)) if (DataBase.Create(dlg.FileName))
{ {
// //
_ = MyConfig.readInteger(MyConfig.TAG_AUTO_LEN, 30); _ = MyConfig.ReadInteger(MyConfig.TAG_AUTO_LEN, 30);
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if (cards[i].desc != null) if (cards[i].desc != null)
......
...@@ -200,6 +200,9 @@ ...@@ -200,6 +200,9 @@
<EmbeddedResource Include="CodeEditForm.resx"> <EmbeddedResource Include="CodeEditForm.resx">
<DependentUpon>CodeEditForm.cs</DependentUpon> <DependentUpon>CodeEditForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\FastColoredTextBoxEx.resx">
<DependentUpon>FastColoredTextBoxEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DataEditForm.resx"> <EmbeddedResource Include="DataEditForm.resx">
<DependentUpon>DataEditForm.cs</DependentUpon> <DependentUpon>DataEditForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -232,8 +235,6 @@ ...@@ -232,8 +235,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="Core\TCGEditor" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
...@@ -56,7 +56,7 @@ public void SetDataPath(string datapath) ...@@ -56,7 +56,7 @@ public void SetDataPath(string datapath)
this.tCards = null; this.tCards = null;
//数据目录 //数据目录
this.datapath = datapath; this.datapath = datapath;
if (MyConfig.readBoolean(MyConfig.TAG_ASYNC)) if (MyConfig.ReadBoolean(MyConfig.TAG_ASYNC))
{ {
//后台加载数据 //后台加载数据
this.bgWorker1.RunWorkerAsync(); this.bgWorker1.RunWorkerAsync();
...@@ -548,7 +548,7 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R ...@@ -548,7 +548,7 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R
private void MainForm_Load(object sender, EventArgs e) private void MainForm_Load(object sender, EventArgs e)
{ {
//检查更新 //检查更新
if (!MyConfig.readBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE)) if (!MyConfig.ReadBoolean(MyConfig.TAG_AUTO_CHECK_UPDATE))
{ {
return; return;
} }
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment