Commit ff93968d authored by keyongyu's avatar keyongyu

2.4.2.1

parent f05f1eb5
......@@ -4,43 +4,46 @@
namespace DataEditorX.Common
{
public class StrUtil
{
public static string AutoEnter(string str, int lineNum, char re)
{
if (str == null || str.Length == 0)
return str;
str = str.Replace("\r\n", "\n");
char[] ch = str.ToCharArray();
int count = ch.Length;
public class StrUtil
{
public static string AutoEnter(string str, int lineNum, char re)
{
if (str == null || str.Length == 0)
return "";
str = " "+str.Replace("\r\n", "\n");
char[] ch = str.ToCharArray();
int count = ch.Length;
StringBuilder sb = new StringBuilder();
int i = 0;
foreach (char c in ch)
{
int ic = c;
if (ic > 128)
i += 2;
else
i += 1;
sb.Append(c);
if (c == '\n' || c == '\r')
{
sb.Append(re);
i = 0;
}
else if(c == re)
{
i = 0;
}
else if (i >= lineNum)
{
sb.Append(re);
i = 0;
}
}
return sb.ToString();
}
}
StringBuilder sb = new StringBuilder();
int i = 0;
foreach (char c in ch)
{
int ic = c;
if (ic > 128)
i += 2;
else
i += 1;
if (c == '\n' || c == '\r')
{
sb.Append(re);
i = 0;
}
else if(c == re)
{
sb.Append(c);
i = 0;
}
else if (i >= lineNum)
{
sb.Append(c);
sb.Append(re);
i = 0;
}else{
sb.Append(c);
}
}
return sb.ToString();
}
}
}
......@@ -19,6 +19,7 @@ public class MyConfig : XMLReader
public const string TAG_SAVE_LAGN2 = "-sl";
public const string TAG_MSE_PATH="mse_path";
public const string TAG_MSE_EXPORT="mse_exprotpath";
public const string TAG_AUTO_LEN ="autolength";
/// <summary>
/// 窗口消息 打开文件
/// </summary>
......
......@@ -130,6 +130,7 @@ private void InitializeComponent()
this.lv_cardlist = new DataEditorX.DListView();
this.ch_cardcode = new System.Windows.Forms.ColumnHeader();
this.ch_cardname = new System.Windows.Forms.ColumnHeader();
this.menuitem_autoreturn = new System.Windows.Forms.ToolStripMenuItem();
this.mainMenu.SuspendLayout();
this.SuspendLayout();
//
......@@ -307,7 +308,8 @@ private void InitializeComponent()
this.menuitem_cutimages,
this.menuitem_convertimage,
this.tsep1,
this.menuitem_cancelTask});
this.menuitem_cancelTask,
this.menuitem_autoreturn});
this.menu_data.Name = "menu_data";
this.menu_data.Size = new System.Drawing.Size(62, 21);
this.menu_data.Text = "Data(&T)";
......@@ -1064,6 +1066,13 @@ private void InitializeComponent()
this.ch_cardname.Text = "Card Name";
this.ch_cardname.Width = 140;
//
// menuitem_autoreturn
//
this.menuitem_autoreturn.Name = "menuitem_autoreturn";
this.menuitem_autoreturn.Size = new System.Drawing.Size(212, 22);
this.menuitem_autoreturn.Text = "*Auto return";
this.menuitem_autoreturn.Click += new System.EventHandler(this.Menuitem_autoreturnClick);
//
// DataEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -1228,5 +1237,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem menuitem_language;
private System.Windows.Forms.ToolStripMenuItem menuitem_export_select_sql;
private System.Windows.Forms.ToolStripMenuItem menuitem_export_all_sql;
private System.Windows.Forms.ToolStripMenuItem menuitem_autoreturn;
}
}
......@@ -1628,7 +1628,7 @@ void Menuitem_testPendulumTextClick(object sender, EventArgs e)
}
void Menuitem_export_select_sqlClick(object sender, EventArgs e)
{
using(SaveFileDialog dlg = new SaveFileDialog()){
using(SaveFileDialog dlg = new SaveFileDialog()){
if(dlg.ShowDialog() == DialogResult.OK){
DataBase.exportSql(dlg.FileName, GetCardList(true));
MyMsg.Show("OK");
......@@ -1644,6 +1644,36 @@ void Menuitem_export_all_sqlClick(object sender, EventArgs e)
}
}
}
void Menuitem_autoreturnClick(object sender, EventArgs e)
{
if (!CheckOpen())
return;
using (SaveFileDialog dlg = new SaveFileDialog())
{
dlg.Title = LanguageHelper.GetMsg(LMSG.SelectDataBasePath);
dlg.Filter = LanguageHelper.GetMsg(LMSG.CdbType);
if (dlg.ShowDialog() == DialogResult.OK)
{
Card[] cards = DataBase.Read(nowCdbFile, true, "");
int count = cards.Length;
if (cards == null || cards.Length == 0)
return;
if (DataBase.Create(dlg.FileName))
{
//
int len = MyConfig.readInteger(MyConfig.TAG_AUTO_LEN, 30);
for (int i = 0; i < count; i++)
{
if(cards[i].desc!=null){
cards[i].desc = StrUtil.AutoEnter(cards[i].desc, len, ' ');
}
}
DataBase.CopyDB(dlg.FileName, false, cards);
MyMsg.Show(LMSG.CopyCardsToDBIsOK);
}
}
}
}
}
}
......@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.4.2.0")]
[assembly: AssemblyVersion("2.4.2.1")]
......@@ -48,5 +48,7 @@
<add key="mse_exprotpath" value="./exprot"/>
<add key="mse_auto_rarity" value="true"/>
<add key="pack_db" value="./pack.db"/>
<!-- 1024 : 40-->
<add key="autolength" value="37"/>
</appSettings>
</configuration>
\ No newline at end of file
★更新历史
2.4.2.1
为了适应ygopro1033.D,增加分行
配置config的autolength,控制每多少个字符,换行
2.4.2.0
更新数据
2.4.1.9
......
......@@ -66,6 +66,7 @@ DataEditForm.mainMenu.menuitem_language 语言
DataEditForm.mainMenu.menuitem_checkupdate 检查更新
DataEditForm.mainMenu.menuitem_autocheckupdate 自动检查更新
DataEditForm.mainMenu.menuitem_github 源码
DataEditForm.mainMenu.menuitem_autoreturn (特殊功能)中文自动换行
#
MainForm.mainMenu.menuitem_file 文件(&F)
MainForm.mainMenu.menuitem_open 打开
......
......@@ -12,6 +12,7 @@ CodeEditForm.mainMenu.menuitem_replace Replace
CodeEditForm.mainMenu.menuitem_setcard Set DataBase
CodeEditForm.mainMenu.menuitem_help Help(&H)
CodeEditForm.mainMenu.menuitem_about About
DataEditForm.mainMenu.menuitem_autoreturn (*)Text auto return
#
DataEditForm.btn_img Import Img
DataEditForm.lb_types Card type
......
[DataEditorX]2.4.2.0[DataEditorX]
[DataEditorX]2.4.2.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
......
No preview for this file type
......@@ -48,5 +48,7 @@
<add key="mse_exprotpath" value="./exprot" />
<add key="mse_auto_rarity" value="true" />
<add key="pack_db" value="./pack.db" />
<!-- 1024 : 40-->
<add key="autolength" value="37" />
</appSettings>
</configuration>
\ No newline at end of file
★更新历史
2.4.2.1
为了适应ygopro1033.D,增加分行
配置config的autolength,控制每多少个字符,换行
2.4.2.0
更新数据
2.4.1.9
......
......@@ -66,6 +66,7 @@ DataEditForm.mainMenu.menuitem_language 语言
DataEditForm.mainMenu.menuitem_checkupdate 检查更新
DataEditForm.mainMenu.menuitem_autocheckupdate 自动检查更新
DataEditForm.mainMenu.menuitem_github 源码
DataEditForm.mainMenu.menuitem_autoreturn (特殊功能)中文自动换行
#
MainForm.mainMenu.menuitem_file 文件(&F)
MainForm.mainMenu.menuitem_open 打开
......
......@@ -12,6 +12,7 @@ CodeEditForm.mainMenu.menuitem_replace Replace
CodeEditForm.mainMenu.menuitem_setcard Set DataBase
CodeEditForm.mainMenu.menuitem_help Help(&H)
CodeEditForm.mainMenu.menuitem_about About
DataEditForm.mainMenu.menuitem_autoreturn (*)Text auto return
#
DataEditForm.btn_img Import Img
DataEditForm.lb_types Card type
......
[DataEditorX]2.4.2.0[DataEditorX]
[DataEditorX]2.4.2.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
......
No preview for this file type
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