Commit 7e704d8b authored by keyongyu's avatar keyongyu

2.0

parent eb0e9f17
Images/
Images_backup/
*.tmp
mse-set.txt
#################
......
......@@ -21,7 +21,6 @@ namespace DataEditorX.Core
public enum MyTask{
NONE,
CheckUpdate,
CopyDataBase,
SaveAsMSE,
CutImages,
ConvertImages,
......@@ -38,6 +37,7 @@ public class TaskHelper
private ImageSet imgSet=new ImageSet();
private MSE mseHelper;
private bool isCancel=false;
private bool isRun=false;
private BackgroundWorker worker;
public TaskHelper(string datapath,BackgroundWorker worker,
......@@ -48,6 +48,10 @@ public class TaskHelper
mseHelper=new MSE(datapath,typedic,racedic);
imgSet.Init();
}
public bool IsRuning()
{
return isRun;
}
public bool IsCancel()
{
return isCancel;
......@@ -196,6 +200,7 @@ public void ConvertImages(string imgpath,string gamepath,bool isreplace)
}
public void Run(){
isCancel=false;
isRun=true;
bool replace;
bool showNew;
switch(nowTask){
......@@ -206,13 +211,6 @@ public void ConvertImages(string imgpath,string gamepath,bool isreplace)
}
OnCheckUpdate(showNew);
break;
case MyTask.CopyDataBase:
if(mArgs!=null && mArgs.Length>=2){
string filename=mArgs[0];
replace=(mArgs[1]==Boolean.TrueString)?true:false;
DataBase.CopyDB(filename, !replace,cardlist);
}
break;
case MyTask.CutImages:
if(mArgs!=null && mArgs.Length>=2){
replace=true;
......@@ -244,6 +242,7 @@ public void ConvertImages(string imgpath,string gamepath,bool isreplace)
}
break;
}
isRun=false;
lastTask=nowTask;
nowTask=MyTask.NONE;
cardlist=null;
......
This diff is collapsed.
......@@ -16,13 +16,14 @@
using DataEditorX.Core;
using DataEditorX.Language;
using WeifenLuo.WinFormsUI.Docking;
namespace DataEditorX
{
public partial class DataEditForm : Form
public partial class DataEditForm : DockContent
{
#region 成员变量
TaskHelper tasker;
TaskHelper tasker=null;
string taskname;
string ydkfile=null;
string imagepath=null;
......@@ -52,17 +53,40 @@ public partial class DataEditForm : Form
Dictionary<long, string> dicSetnames=null;
Dictionary<long, string> dicCardTypes=null;
Dictionary<long, string> dicCardcategorys=null;
string conflang, confrule, confattribute, confrace, conflevel;
string confsetname, conftype, confcategory, confcover, confmsg;
public DataEditForm(string cdbfile)
string datapath, confrule, confattribute, confrace, conflevel;
string confsetname, conftype, confcategory, confcover;
public string getNowCDB()
{
InitializeComponent();
return nowCdbFile;
}
public DataEditForm(string datapath,string cdbfile)
{
InitPath(datapath);
Initialize();
nowCdbFile=cdbfile;
}
public DataEditForm(string datapath)
{
InitPath(datapath);
Initialize();
}
public DataEditForm()
{
string dir=ConfigurationManager.AppSettings["language"];
if(string.IsNullOrEmpty(dir))
{
Application.Exit();
}
datapath=Path.Combine(Application.StartupPath, dir);
InitPath(datapath);
Initialize();
}
void Initialize()
{
InitializeComponent();
title=this.Text;
nowCdbFile="";
}
......@@ -74,25 +98,13 @@ void DataEditFormLoad(object sender, EventArgs e)
{
InitListRows();
//界面初始化
string dir=ConfigurationManager.AppSettings["language"];
if(string.IsNullOrEmpty(dir))
{
Application.Exit();
}
string datapath=Path.Combine(Application.StartupPath, dir);
InitPath(datapath);
LANG.InitForm(this, conflang);
LANG.LoadMessage(confmsg);
LANG.SetLanguage(this);
this.Text=this.Text+" Ver:"+Application.ProductVersion;
HideMenu();
#if DEBUG
this.Text=this.Text+"(DEBUG)";
title=title+"(DEBUG)";
#endif
title=this.Text;
SetTitle();
InitGameData();
tasker=new TaskHelper(datapath, bgWorker1, dicCardTypes, dicCardRaces);
......@@ -109,24 +121,65 @@ void DataEditFormLoad(object sender, EventArgs e)
//窗体关闭
void DataEditFormFormClosing(object sender, FormClosingEventArgs e)
{
#if DEBUG
LANG.GetLanguage(this);
LANG.SaveLanguage(this, conflang+"bak.txt");
LANG.SaveMessage(confmsg+"bak.txt");
#endif
if(tasker!=null && tasker.IsRuning())
{
if(!CancelTask())
{
e.Cancel=true;
return;
}
}
if(!string.IsNullOrEmpty(nowCdbFile)){
Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
cfa.AppSettings.Settings["cdb"].Value = nowCdbFile;
cfa.Save(ConfigurationSaveMode.Modified);
}
}
void DataEditFormEnter(object sender, EventArgs e)
{
SetTitle();
}
void HideMenu()
{
if(this.MdiParent ==null)
return;
menuStrip1.Visible=false;
menuitem_file.Visible=false;
//this.SuspendLayout();
this.ResumeLayout(true);
foreach(Control c in this.Controls)
{
if(c.GetType()==typeof(MenuStrip))
continue;
Point p=c.Location;
c.Location=new Point(p.X, p.Y-25);
}
this.ResumeLayout(false);
//this.PerformLayout();
}
void SetTitle()
{
if(string.IsNullOrEmpty(nowCdbFile))
this.Text=title;
string str=title;
string str2=title;
if(!string.IsNullOrEmpty(nowCdbFile)){
str=nowCdbFile+"-"+str;
str2=Path.GetFileName(nowCdbFile);
}
if(this.MdiParent !=null)
{
this.Text=str2;
if(tasker!=null && tasker.IsRuning()){
if(DockPanel.ActiveContent == this)
this.MdiParent.Text=str;
}
else
this.MdiParent.Text=str;
}
else
this.Text=nowCdbFile+"-"+title;
this.Text=str;
}
//按cdb路径设置目录
void SetCDB(string cdb)
......@@ -148,7 +201,7 @@ void SetCDB(string cdb)
//初始化文件路径
void InitPath(string datapath)
{
conflang=Path.Combine(datapath, "language.txt");
this.datapath=datapath;
confrule=Path.Combine(datapath, "card-rule.txt");
confattribute=Path.Combine(datapath, "card-attribute.txt");
confrace=Path.Combine(datapath, "card-race.txt");
......@@ -157,8 +210,7 @@ void InitPath(string datapath)
conftype=Path.Combine(datapath, "card-type.txt");
confcategory=Path.Combine(datapath, "card-category.txt");
confcover= Path.Combine(datapath, "cover.jpg");
confmsg = Path.Combine(datapath, "message.txt");
IMAGEPATH=Path.Combine(Application.StartupPath,"Images");
}
......@@ -974,16 +1026,21 @@ void checkupdate(bool showNew)
Run(LANG.GetMsg(LMSG.checkUpdate));
}
}
void Menuitem_cancelTaskClick(object sender, EventArgs e)
{
if(MyMsg.Question(LMSG.IfCancelTask)){
if(bgWorker1.IsBusy){
tasker.Cancel();
bgWorker1.CancelAsync();
}
}
}
bool CancelTask()
{
bool bl=MyMsg.Question(LMSG.IfCancelTask);
if(bl){
if(tasker!=null)
tasker.Cancel();
if(bgWorker1.IsBusy)
bgWorker1.CancelAsync();
}
return bl;
}
void Menuitem_cancelTaskClick(object sender, EventArgs e)
{
CancelTask();
}
void Menuitem_githubClick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(ConfigurationManager.AppSettings["sourceURL"]);
......@@ -1028,6 +1085,8 @@ void Menuitem_compdbClick(object sender, EventArgs e)
}
void Menuitem_convertimageClick(object sender, EventArgs e)
{
if(!Check())
return;
if(isRun())
return;
using(FolderBrowserDialog fdlg=new FolderBrowserDialog())
......@@ -1088,7 +1147,7 @@ void Menuitem_quitClick(object sender, EventArgs e)
#region 线程
bool isRun(){
if(bgWorker1.IsBusy){
if(tasker !=null && tasker.IsRuning()){
MyMsg.Warning(LMSG.RunError);
return true;
}
......@@ -1116,7 +1175,7 @@ void BgWorker1ProgressChanged(object sender, System.ComponentModel.ProgressChang
title=string.Format("{0} ({1}-{2})",
title.Substring(0,t),
taskname,
// e.ProgressPercentage,
// e.ProgressPercentage,
e.UserState);
SetTitle();
}
......@@ -1143,9 +1202,6 @@ void BgWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerC
MyTask mt=tasker.getLastTask();
switch(mt){
case MyTask.CheckUpdate:break;
case MyTask.CopyDataBase:
MyMsg.Show(LMSG.copyDBIsOK);
break;
case MyTask.CutImages:
MyMsg.Show(LMSG.CutImageOK);
break;
......@@ -1243,7 +1299,7 @@ void Tb_setcode1TextChanged(object sender, EventArgs e)
#endregion
#region 复制卡片
Card[] getCardList(bool onlyselect){
public Card[] getCardList(bool onlyselect){
List<Card> cards=new List<Card>();
if(onlyselect)
{
......@@ -1274,12 +1330,17 @@ void Menuitem_copyselecttoClick(object sender, EventArgs e)
{
CopyTo(true);
}
void CopyTo(bool onlyselect)
public void SaveCards(Card[] cards)
{
if(!Check())
return;
if(isRun())
bool replace=MyMsg.Question(LMSG.IfReplaceExistingCard);
DataBase.CopyDB(nowCdbFile, !replace, cards);
Search(srcCard, true);
}
void CopyTo(bool onlyselect)
{
if(!Check())
return;
Card[] cards=getCardList(onlyselect);
if(cards==null)
......@@ -1298,8 +1359,8 @@ void CopyTo(bool onlyselect)
}
}
if(!string.IsNullOrEmpty(filename)){
tasker.SetTask(MyTask.CopyDataBase, cards, filename, replace.ToString());
Run(LANG.GetMsg(LMSG.copyCards));
DataBase.CopyDB(filename, !replace, cards);
MyMsg.Show(LMSG.CopyCardsToDBIsOK);
}
}
......@@ -1392,6 +1453,6 @@ void InportImage(string file,string tid)
pl_image.BackgroundImage=m_cover;
}
#endregion
}
}
......@@ -53,6 +53,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WeifenLuo.WinFormsUI.Docking">
<HintPath>DLL\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Common\CheckUpdate.cs" />
......@@ -77,6 +80,10 @@
<Compile Include="Language\LanguageHelper.cs" />
<Compile Include="Language\LMsg.cs" />
<Compile Include="Language\MyMsg.cs" />
<Compile Include="MainForm.cs" />
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
......@@ -84,6 +91,9 @@
<EmbeddedResource Include="DataEditForm.resx">
<DependentUpon>DataEditForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Folder Include="chinese" />
......@@ -122,7 +132,10 @@
<None Include="chinese\cover.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="chinese\language.txt">
<None Include="chinese\language-dataeditor.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="chinese\language-mainform.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="chinese\message.txt">
......@@ -167,7 +180,10 @@
<None Include="english\cover.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="english\language.txt">
<None Include="english\language-dataeditor.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="english\language-mainform.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="english\message.txt">
......
......@@ -54,8 +54,8 @@ public enum LMSG : uint
ImageType,
RunError,
checkUpdate,
copyCards,
copyDBIsOK,
CopyCardsToDB,
CopyCardsToDBIsOK,
selectMseset,
MseType,
SaveMse,
......@@ -73,6 +73,8 @@ public enum LMSG : uint
ResumeTask,
TaskError,
IfCancelTask,
CopyCards,
PasteCards,
COUNT,
}
}
......@@ -19,21 +19,21 @@ namespace DataEditorX.Language
/// </summary>
public static class LANG
{
static Dictionary<Form, SortedList<string, string>> wordslist;
static Dictionary<string, SortedList<string, string>> wordslist;
static SortedList<LMSG, string> msglist;
static string SEP="->";
static LANG()
{
wordslist=new Dictionary<Form, SortedList<string, string>>();
wordslist=new Dictionary<string, SortedList<string, string>>();
msglist=new SortedList<LMSG, string>();
}
public static void InitForm(Form fm, string langfile)
{
if(!wordslist.ContainsKey(fm))
if(!wordslist.ContainsKey(fm.Name))
{
wordslist.Add(fm, LoadLanguage(langfile));
wordslist.Add(fm.Name, LoadLanguage(langfile));
}
}
......@@ -56,10 +56,14 @@ public static string GetMsg(LMSG lMsg)
/// <param name="fm"></param>
public static bool SetLanguage(Form fm)
{
if(wordslist.ContainsKey(fm))
if(wordslist.ContainsKey(fm.Name))
{
SortedList<string, string> list=wordslist[fm];
SortedList<string, string> list=wordslist[fm.Name];
// fm.SuspendLayout();
fm.ResumeLayout(true);
SetText(fm, list);
fm.ResumeLayout(false);
//fm.PerformLayout();
return true;
}
return false;
......@@ -155,10 +159,10 @@ public static void GetLanguage(Form fm)
{
SortedList<string, string> list=new SortedList<string, string>();
GetText(fm, list);
if(wordslist.ContainsKey(fm))
wordslist[fm]=list;
if(wordslist.ContainsKey(fm.Name))
wordslist[fm.Name]=list;
else
wordslist.Add(fm, list);
wordslist.Add(fm.Name, list);
}
static void GetText(Control c, SortedList<string, string> list)
{
......@@ -244,9 +248,9 @@ static void GetMenuItem(ToolStripItem tsi, SortedList<string, string> list)
#region 保存语言文件
public static bool SaveLanguage(Form fm, string f)
{
if(!wordslist.ContainsKey(fm))
if(!wordslist.ContainsKey(fm.Name))
return false;
SortedList<string, string> fmlist=wordslist[fm];
SortedList<string, string> fmlist=wordslist[fm.Name];
using(FileStream fs=new FileStream(f, FileMode.Create, FileAccess.Write))
{
StreamWriter sw=new StreamWriter(fs, Encoding.UTF8);
......
This diff is collapsed.
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-20
* 时间: 9:19
*
*/
using System;
using System.Drawing;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using System.Configuration;
using WeifenLuo.WinFormsUI.Docking;
using DataEditorX.Language;
using DataEditorX.Core;
namespace DataEditorX
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public const int CLOSE_ONE=1;
public const int CLOSE_OTHER=2;
public const int CLOSE_ALL=3;
public const int WM_OPEN=0x0401;
public const string TMPFILE="open.tmp";
string datapath;
string conflang,conflang_de,confmsg;
Card[] tCards;
Dictionary<DataEditForm,string> list;
#region init
public MainForm(string datapath, string file)
{
Init(datapath);
Open(file);
}
public MainForm(string datapath)
{
Init(datapath);
}
void Init(string datapath)
{
tCards=null;
list=new Dictionary<DataEditForm,string>();
this.datapath=datapath;
conflang = Path.Combine(datapath, "language-mainform.txt");
conflang_de = Path.Combine(datapath, "language-dataeditor.txt");
confmsg = Path.Combine(datapath, "message.txt");
InitializeComponent();
LANG.InitForm(this, conflang);
LANG.LoadMessage(confmsg);
LANG.SetLanguage(this);
}
#endregion
#region message
protected override void DefWndProc(ref System.Windows.Forms.Message m)
{
switch (m.Msg)
{
case MainForm.WM_OPEN://处理消息
string file=Path.Combine(Application.StartupPath, MainForm.TMPFILE);
if(File.Exists(file)){
Open(File.ReadAllText(file));
File.Delete(file);
}
break;
default:
base.DefWndProc(ref m);
break;
}
}
#endregion
#region DataEditor
public void Open(string file)
{
if(checkOpen(file))
return;
if(OpenInNull(file))
return;
DataEditForm def;
if(string.IsNullOrEmpty(file)|| !File.Exists(file))
def=new DataEditForm(datapath);
else
def=new DataEditForm(datapath,file);
LANG.InitForm(def, conflang_de);
LANG.SetLanguage(def);
def.FormClosed+=new FormClosedEventHandler(def_FormClosed);
def.Show(dockPanel1, DockState.Document);
list.Add(def, "");
}
bool checkOpen(string file)
{
foreach(DataEditForm df in list.Keys)
{
if(df!=null && !df.IsDisposed)
{
if(df.getNowCDB()==file)
return true;
}
}
return false;
}
bool OpenInNull(string file)
{
if(string.IsNullOrEmpty(file) || !File.Exists(file))
return false;
foreach(DataEditForm df in list.Keys)
{
if(df!=null && !df.IsDisposed)
{
if(string.IsNullOrEmpty(df.getNowCDB())){
df.Open(file);
return true;
}
}
}
return false;
}
void def_FormClosed(object sender, FormClosedEventArgs e)
{
DataEditForm df=sender as DataEditForm;
if(df!=null)
{
list.Remove(df);
}
}
void DataEditorToolStripMenuItemClick(object sender, EventArgs e)
{
Open(null);
}
#endregion
#region form
void MainFormLoad(object sender, System.EventArgs e)
{
}
void MainFormFormClosing(object sender, FormClosingEventArgs e)
{
#if DEBUG
LANG.SaveMessage(confmsg+".bak");
#endif
}
#endregion
#region windows
void CloseToolStripMenuItemClick(object sender, EventArgs e)
{
CloseMdi(MainForm.CLOSE_ONE);
}
void CloseMdi(int type)
{
DockContentCollection contents = dockPanel1.Contents;
int num = contents.Count-1;
try{
while (num >=0)
{
if (contents[num].DockHandler.DockState == DockState.Document)
{
if(type==MainForm.CLOSE_ALL)
contents[num].DockHandler.Close();
else if(type==MainForm.CLOSE_ONE
&& dockPanel1.ActiveContent == contents[num])
contents[num].DockHandler.Close();
else if(type==MainForm.CLOSE_OTHER
&& dockPanel1.ActiveContent != contents[num])
contents[num].DockHandler.Close();
}
num--;
}
}catch{}
}
void CloseOtherToolStripMenuItemClick(object sender, EventArgs e)
{
CloseMdi(MainForm.CLOSE_OTHER);
}
void CloseAllToolStripMenuItemClick(object sender, EventArgs e)
{
CloseMdi(MainForm.CLOSE_ALL);
}
#endregion
#region file
void Menuitem_openClick(object sender, EventArgs e)
{
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.SelectDataBasePath);
dlg.Filter=LANG.GetMsg(LMSG.CdbType);
if(dlg.ShowDialog()==DialogResult.OK)
{
Open(dlg.FileName);
}
}
}
void QuitToolStripMenuItemClick(object sender, EventArgs e)
{
Application.Exit();
}
void Menuitem_openLastDataBaseClick(object sender, EventArgs e)
{
string cdb=System.Configuration.ConfigurationManager.AppSettings["cdb"];
if(File.Exists(cdb))
Open(cdb);
}
void Menuitem_newClick(object sender, EventArgs e)
{
using(SaveFileDialog dlg=new SaveFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.SelectDataBasePath);
dlg.Filter=LANG.GetMsg(LMSG.CdbType);
if(dlg.ShowDialog()==DialogResult.OK)
{
if(DataBase.Create(dlg.FileName))
{
if(MyMsg.Question(LMSG.IfOpenDataBase))
Open(dlg.FileName);
}
}
}
}
#endregion
#region copy
DataEditForm GetActive()
{
foreach(DataEditForm df in list.Keys)
{
if(df==dockPanel1.ActiveContent)
return df;
}
return null;
}
void Menuitem_copyselecttoClick(object sender, EventArgs e)
{
DataEditForm df =GetActive();
if(df!=null)
{
tCards=df.getCardList(true);
if(tCards!=null){
SetCopyNumber(tCards.Length);
MyMsg.Show(LMSG.CopyCards);
}
}
}
void SetCopyNumber(int c)
{
string tmp=menuitem_pastecards.Text;
int t=tmp.LastIndexOf(" (");
if(t>0)
tmp=tmp.Substring(0,t);
tmp=tmp+" ("+c.ToString()+")";
menuitem_pastecards.Text=tmp;
}
void Menuitem_pastecardsClick(object sender, EventArgs e)
{
if(tCards==null)
return;
DataEditForm df =GetActive();
if(df==null)
return;
df.SaveCards(tCards);
MyMsg.Show(LMSG.PasteCards);
}
#endregion
}
}
<?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>
<metadata name="dockPanel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>
\ No newline at end of file
......@@ -7,29 +7,81 @@
*/
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Configuration;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.Reflection;
namespace DataEditorX
{
/// <summary>
/// Class with program entry point.
/// </summary>
internal sealed class Program
{
/// <summary>
/// Program entry point.
/// </summary>
[STAThread]
private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string arg="";
if(args.Length>0)
{
arg=args[0];
}
Application.Run(new DataEditForm(arg));
}
}
/// Class with program entry point.
/// </summary>
internal sealed class Program
{
[DllImport("User32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(IntPtr hWnd, int msg, uint wParam, uint lParam);
/// <summary>
/// <summary>
/// Program entry point.
/// </summary>
[STAThread]
private static void Main(string[] args)
{
string arg="";
if(args.Length>0)
{
arg=args[0];
}
Process instance = RunningInstance();
if (instance == null)
{
ShowForm(arg);
}
else
{
File.WriteAllText(Path.Combine(Application.StartupPath, MainForm.TMPFILE), arg);
SendMessage(instance.MainWindowHandle, MainForm.WM_OPEN, 0 ,0);
//Thread.Sleep(1000);
Environment.Exit(1);
}
}
private static Process RunningInstance()
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName(current.ProcessName);
//遍历与当前进程名称相同的进程列表
foreach (Process process in processes)
{
//如果实例已经存在则忽略当前进程
if (process.Id != current.Id)
{
//保证要打开的进程同已经存在的进程来自同一文件路径
if (Assembly.GetExecutingAssembly().Location.
Replace('/', Path.DirectorySeparatorChar)
== current.MainModule.FileName)
{
//返回已经存在的进程
return process;
}
}
}
return null;
}
static void ShowForm(string file)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string dir=ConfigurationManager.AppSettings["language"];
if(string.IsNullOrEmpty(dir))
{
Application.Exit();
}
string datapath=Path.Combine(Application.StartupPath, dir);
Application.Run(new MainForm(datapath, file));
}
}
}
......@@ -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("1.6.8.0")]
[assembly: AssemblyVersion("2.0.0.2")]
......@@ -8,7 +8,7 @@ DataEditForm->btn_PageDown 下一页
DataEditForm->btn_PageUp 上一页
DataEditForm->btn_reset 重置(&R)
DataEditForm->btn_serach 搜索(&S)
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->DataEditForm DataEditorX
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias 同名卡
DataEditForm->lb_cardcode 卡片密码
......
MainForm->menuitem_file 文件(&F)
MainForm->menuitem_new 新建(&N)
MainForm->menuitem_open 打开(&O)
MainForm->menuitem_copyselect 复制所选卡片
MainForm->menuitem_pastecards 粘贴卡片
MainForm->menuitem_openLastDataBase 最后打开的数据库
MainForm->menuitem_quit 退出(&Q)
MainForm->menuitem_windows 窗口(&W)
MainForm->menuitem_dataeditor 新建标签
MainForm->menuitem_closeall 关闭所有
MainForm->menuitem_closeother 关闭其他
MainForm->menuitem_close 关闭当前
\ No newline at end of file
......@@ -56,4 +56,6 @@
0x37 任务已经暂停
0x38 继续任务
0x39 任务出错
0x3a 是否取消当前任务?
\ No newline at end of file
0x3a 是否取消当前任务?
0x3b 复制完成
0x3c 粘贴完成
\ No newline at end of file
......@@ -8,7 +8,7 @@ DataEditForm->btn_PageDown >>
DataEditForm->btn_PageUp <<
DataEditForm->btn_reset Rest
DataEditForm->btn_serach Search
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->DataEditForm DataEditorX
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias Alias
DataEditForm->lb_cardcode Card Code
......
MainForm->menuitem_file File
MainForm->menuitem_new New DataBase
MainForm->menuitem_open Open DataBase
MainForm->menuitem_copyselect Copy Select
MainForm->menuitem_pastecards Paste Cards
MainForm->menuitem_openLastDataBase Open Last DataBase
MainForm->menuitem_quit Quit(&Q)
MainForm->menuitem_windows Windwos(&W)
MainForm->menuitem_dataeditor New DataEditor
MainForm->menuitem_closeall Close All
MainForm->menuitem_closeother Close Other
MainForm->menuitem_close Close
\ No newline at end of file
......@@ -56,4 +56,6 @@
0x37 Task is Paused
0x38 Task is Resume
0x39 Task has Error
0x3a Cancel Task?
\ No newline at end of file
0x3a Cancel Task?
0x3b Copy
0x3c Paste
\ No newline at end of file
[DataEditorX]1.6.8.0[DataEditorX]
[DataEditorX]2.0.0.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -66,6 +66,12 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.0.0.2
复制卡片,粘贴卡片
2.0.0.1
分离文件菜单,下个版本,改进复制卡片功能
2.0.0.0
多标签界面
1.6.8.0
不再支持自动更新,请大家每天手动更新,下个版本添加多cdb编辑
把文件菜单的项分开
......
No preview for this file type
......@@ -8,7 +8,7 @@ DataEditForm->btn_PageDown 下一页
DataEditForm->btn_PageUp 上一页
DataEditForm->btn_reset 重置(&R)
DataEditForm->btn_serach 搜索(&S)
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->DataEditForm DataEditorX
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias 同名卡
DataEditForm->lb_cardcode 卡片密码
......
MainForm->menuitem_file 文件(&F)
MainForm->menuitem_new 新建(&N)
MainForm->menuitem_open 打开(&O)
MainForm->menuitem_copyselect 复制所选卡片
MainForm->menuitem_pastecards 粘贴卡片
MainForm->menuitem_openLastDataBase 最后打开的数据库
MainForm->menuitem_quit 退出(&Q)
MainForm->menuitem_windows 窗口(&W)
MainForm->menuitem_dataeditor 新建标签
MainForm->menuitem_closeall 关闭所有
MainForm->menuitem_closeother 关闭其他
MainForm->menuitem_close 关闭当前
\ No newline at end of file
......@@ -56,4 +56,6 @@
0x37 任务已经暂停
0x38 继续任务
0x39 任务出错
0x3a 是否取消当前任务?
\ No newline at end of file
0x3a 是否取消当前任务?
0x3b 复制完成
0x3c 粘贴完成
\ No newline at end of file
......@@ -8,7 +8,7 @@ DataEditForm->btn_PageDown >>
DataEditForm->btn_PageUp <<
DataEditForm->btn_reset Rest
DataEditForm->btn_serach Search
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->DataEditForm DataEditorX
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias Alias
DataEditForm->lb_cardcode Card Code
......
MainForm->menuitem_file File
MainForm->menuitem_new New DataBase
MainForm->menuitem_open Open DataBase
MainForm->menuitem_copyselect Copy Select
MainForm->menuitem_pastecards Paste Cards
MainForm->menuitem_openLastDataBase Open Last DataBase
MainForm->menuitem_quit Quit(&Q)
MainForm->menuitem_windows Windwos(&W)
MainForm->menuitem_dataeditor New DataEditor
MainForm->menuitem_closeall Close All
MainForm->menuitem_closeother Close Other
MainForm->menuitem_close Close
\ No newline at end of file
......@@ -56,4 +56,6 @@
0x37 Task is Paused
0x38 Task is Resume
0x39 Task has Error
0x3a Cancel Task?
\ No newline at end of file
0x3a Cancel Task?
0x3b Copy
0x3c Paste
\ No newline at end of file
[DataEditorX]1.6.8.0[DataEditorX]
[DataEditorX]2.0.0.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
......@@ -66,6 +66,12 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
2.0.0.2
复制卡片,粘贴卡片
2.0.0.1
分离文件菜单,下个版本,改进复制卡片功能
2.0.0.0
多标签界面
1.6.8.0
不再支持自动更新,请大家每天手动更新,下个版本添加多cdb编辑
把文件菜单的项分开
......
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