Commit 0e68accd authored by JoyJ's avatar JoyJ

initial commit

parents
.vs/WBJsonGenerator/v15/.suo
.vs/WBJsonGenerator/v15/Server/sqlite3/db.lock
.vs/WBJsonGenerator/v15/Server/sqlite3/storage.ide
.vs/WBJsonGenerator/v15/Server/sqlite3/storage.ide-shm
.vs/WBJsonGenerator/v15/Server/sqlite3/storage.ide-wal
.vs/config/applicationhost.config
WBJsonGenerator/bin/Debug/sample.zh-CN.json
WBJsonGenerator/bin/Debug/WBJsonGenerator.exe
WBJsonGenerator/bin/Debug/WBJsonGenerator.exe.config
WBJsonGenerator/bin/Debug/WBJsonGenerator.pdb
WBJsonGenerator/bin/Release/sample.zh-CN.json
WBJsonGenerator/bin/Release/WBJsonGenerator.exe
WBJsonGenerator/bin/Release/WBJsonGenerator.exe.config
WBJsonGenerator/bin/Release/WBJsonGenerator.pdb
WBJsonGenerator/obj/Debug/DesignTimeResolveAssemblyReferences.cache
WBJsonGenerator/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
WBJsonGenerator/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
WBJsonGenerator/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
WBJsonGenerator/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
WBJsonGenerator/obj/Debug/WBJsonGenerator.csproj.CoreCompileInputs.cache
WBJsonGenerator/obj/Debug/WBJsonGenerator.csproj.FileListAbsolute.txt
WBJsonGenerator/obj/Debug/WBJsonGenerator.csproj.GenerateResource.cache
WBJsonGenerator/obj/Debug/WBJsonGenerator.csprojAssemblyReference.cache
WBJsonGenerator/obj/Debug/WBJsonGenerator.exe
WBJsonGenerator/obj/Debug/WBJsonGenerator.pdb
WBJsonGenerator/obj/Debug/WBJsonGenerator.Properties.Resources.resources
WBJsonGenerator/obj/Debug/WBJsonGenerator.WBJsonGenerator.resources
WBJsonGenerator/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
WBJsonGenerator/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
WBJsonGenerator/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
WBJsonGenerator/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
WBJsonGenerator/obj/Release/WBJsonGenerator.csproj.CoreCompileInputs.cache
WBJsonGenerator/obj/Release/WBJsonGenerator.csproj.FileListAbsolute.txt
WBJsonGenerator/obj/Release/WBJsonGenerator.csproj.GenerateResource.cache
WBJsonGenerator/obj/Release/WBJsonGenerator.exe
WBJsonGenerator/obj/Release/WBJsonGenerator.pdb
WBJsonGenerator/obj/Release/WBJsonGenerator.Properties.Resources.resources
WBJsonGenerator/obj/Release/WBJsonGenerator.WBJsonGenerator.resources

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1169
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WBJsonGenerator", "WBJsonGenerator\WBJsonGenerator.csproj", "{19E165F2-EC28-4078-9B79-65071C960124}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{19E165F2-EC28-4078-9B79-65071C960124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19E165F2-EC28-4078-9B79-65071C960124}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19E165F2-EC28-4078-9B79-65071C960124}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19E165F2-EC28-4078-9B79-65071C960124}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A3101BF6-D847-4074-80A4-797BCE9161C8}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WBJsonGenerator
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new WBJsonGenerator());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("WBJsonGenerator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WBJsonGenerator")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("19e165f2-ec28-4078-9b79-65071c960124")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace WBJsonGenerator.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WBJsonGenerator.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WBJsonGenerator.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
namespace WBJsonGenerator
{
partial class WBJsonGenerator
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.txtString = new System.Windows.Forms.TextBox();
this.listJsonType = new System.Windows.Forms.ListBox();
this.listJsonString = new System.Windows.Forms.ListBox();
this.btnAdd = new System.Windows.Forms.Button();
this.btnDeleteSelected = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.sfdJson = new System.Windows.Forms.SaveFileDialog();
this.btnLoad = new System.Windows.Forms.Button();
this.ofdJson = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// txtString
//
this.txtString.Location = new System.Drawing.Point(12, 12);
this.txtString.Name = "txtString";
this.txtString.Size = new System.Drawing.Size(398, 19);
this.txtString.TabIndex = 6;
//
// listJsonType
//
this.listJsonType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.listJsonType.FormattingEnabled = true;
this.listJsonType.ItemHeight = 12;
this.listJsonType.Items.AddRange(new object[] {
"welcome|加入房间时。{0}为AI名字",
"deckerror|发现卡组不能用时。{0}为不能用的卡名",
"duelstart|决斗开始时",
"newturn|自己的回合开始时",
"endturn|自己的回合结束时",
"directattack|AI对玩家进行直接攻击时。{0}为攻击怪兽卡名",
"attack|AI对玩家的怪兽攻击时。{0}为攻击怪兽,{1}为被攻击怪兽卡名",
"ondirectattack|AI被玩家直接攻击时。{0}为攻击怪兽卡名",
"facedownmonstername|AI对处于盖伏状态的怪兽的称呼",
"activate|AI将一个效果发动时。{0}为发动的效果的卡名",
"summon|AI将怪兽出场时,包含召唤、反转召唤、特殊召唤。{0}为召唤的卡名",
"setmonster|AI将怪兽盖伏时",
"chaining|AI进行连锁时。{0}为连锁的卡名"});
this.listJsonType.Location = new System.Drawing.Point(12, 37);
this.listJsonType.Name = "listJsonType";
this.listJsonType.Size = new System.Drawing.Size(398, 292);
this.listJsonType.TabIndex = 0;
this.listJsonType.SelectedIndexChanged += new System.EventHandler(this.listJsonType_SelectedIndexChanged);
//
// listJsonString
//
this.listJsonString.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listJsonString.FormattingEnabled = true;
this.listJsonString.ItemHeight = 12;
this.listJsonString.Location = new System.Drawing.Point(416, 37);
this.listJsonString.Name = "listJsonString";
this.listJsonString.Size = new System.Drawing.Size(235, 292);
this.listJsonString.TabIndex = 3;
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(416, 8);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(52, 23);
this.btnAdd.TabIndex = 7;
this.btnAdd.Text = "追加";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnDeleteSelected
//
this.btnDeleteSelected.Location = new System.Drawing.Point(474, 8);
this.btnDeleteSelected.Name = "btnDeleteSelected";
this.btnDeleteSelected.Size = new System.Drawing.Size(63, 23);
this.btnDeleteSelected.TabIndex = 8;
this.btnDeleteSelected.Text = "删除选中";
this.btnDeleteSelected.UseVisualStyleBackColor = true;
this.btnDeleteSelected.Click += new System.EventHandler(this.btnDeleteSelected_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(543, 8);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(51, 23);
this.btnSave.TabIndex = 9;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// sfdJson
//
this.sfdJson.DefaultExt = "json";
this.sfdJson.FileName = "Lucky0.zh-CN.json";
this.sfdJson.Filter = "JSON文件|*.json";
//
// btnLoad
//
this.btnLoad.Location = new System.Drawing.Point(600, 8);
this.btnLoad.Name = "btnLoad";
this.btnLoad.Size = new System.Drawing.Size(51, 23);
this.btnLoad.TabIndex = 10;
this.btnLoad.Text = "读取";
this.btnLoad.UseVisualStyleBackColor = true;
this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
//
// ofdJson
//
this.ofdJson.FileName = "openFileDialog1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(663, 339);
this.Controls.Add(this.btnLoad);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.btnDeleteSelected);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.txtString);
this.Controls.Add(this.listJsonString);
this.Controls.Add(this.listJsonType);
this.Name = "Form1";
this.Text = "Windbot台词生成器 v0.1 by JoyJ";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txtString;
private System.Windows.Forms.ListBox listJsonType;
private System.Windows.Forms.ListBox listJsonString;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnDeleteSelected;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.SaveFileDialog sfdJson;
private System.Windows.Forms.Button btnLoad;
private System.Windows.Forms.OpenFileDialog ofdJson;
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Windows.Forms;
namespace WBJsonGenerator
{
public partial class WBJsonGenerator : Form
{
public WBJsonGenerator()
{
this.InitializeComponent();
}
Dictionary<string,List<string>> dic = new Dictionary<string, List<string>>();
private void listJsonType_SelectedIndexChanged(object sender, EventArgs e)
{
listJsonString.Items.Clear();
if (listJsonType.SelectedIndex < 0)
{
return;
}
foreach (string str in dic[listJsonType.SelectedItem.ToString().Split('|')[0]])
{
listJsonString.Items.Add(str);
}
}
private void Form1_Load(object sender, EventArgs e)
{
foreach(string str in listJsonType.Items)
{
dic.Add(str.Split('|')[0], new List<string>());
}
listJsonType.SelectedIndex = 0;
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (listJsonType.SelectedItem == null)
{
return;
}
dic[listJsonType.SelectedItem.ToString().Split('|')[0]].Add(txtString.Text);
listJsonString.Items.Add(txtString.Text);
}
private void btnDeleteSelected_Click(object sender, EventArgs e)
{
if (listJsonType.SelectedItem == null)
{
return;
}
for (int i = listJsonString.Items.Count; i >= 0; i--)
{
if (listJsonString.SelectedIndices.Contains(i))
{
dic[listJsonType.SelectedItem.ToString().Split('|')[0]].RemoveAt(i);
listJsonString.Items.RemoveAt(i);
}
}
}
JavaScriptSerializer jss = new JavaScriptSerializer();
private void btnSave_Click(object sender, EventArgs e)
{
Dictionary<string, object> newDic = new Dictionary<string, object>();
foreach(var kvp in dic)
{
if (kvp.Value.Count < 1)
{
MessageBox.Show($"错误:{kvp.Key}尚未填写,无法保存。");
return;
}
if (kvp.Key == "facedownmonstername")
{
if (kvp.Value.Count > 1)
{
MessageBox.Show($"错误:{kvp.Key}里只能填写一个称呼。");
return;
}
else
{
newDic.Add(kvp.Key, kvp.Value[0]);
continue;
}
}
newDic.Add(kvp.Key, kvp.Value);
}
if (sfdJson.ShowDialog() == DialogResult.OK)
{
File.WriteAllText(sfdJson.FileName,jss.Serialize(newDic));
}
}
private void btnLoad_Click(object sender, EventArgs e)
{
ofdJson.InitialDirectory = Environment.CurrentDirectory;
if (ofdJson.ShowDialog() == DialogResult.OK)
{
string content = File.ReadAllText(ofdJson.FileName);
object ooo = jss.DeserializeObject(content);
var obj = jss.Deserialize<Dictionary<string, object>>(content);
dic.Clear();
foreach(var kvp in obj)
{
if (kvp.Key == "facedownmonstername")
{
}
dic.Add(kvp.Key, new List<string>());
if (kvp.Value is string)
{
dic[kvp.Key].Add(kvp.Value.ToString());
}
else
{
foreach (string o in kvp.Value as ArrayList)
{
dic[kvp.Key].Add(o);
}
}
}
listJsonType.SelectedIndex = -1;
listJsonString.Items.Clear();
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{19E165F2-EC28-4078-9B79-65071C960124}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>WBJsonGenerator</RootNamespace>
<AssemblyName>WBJsonGenerator</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WBJsonGenerator.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WBJsonGenerator.Designer.cs">
<DependentUpon>WBJsonGenerator.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="WBJsonGenerator.resx">
<DependentUpon>WBJsonGenerator.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="sample.zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?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>
<metadata name="sfdJson.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofdJson.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>109, 17</value>
</metadata>
</root>
\ No newline at end of file
{ "welcome": [ "欢迎来到编年史。我是{0}的分身,请多指教。" ], "deckerror": [ "出现了未知错误:无法使用{0}。" ], "duelstart": [ "开始切磋交流吧。", "是时候开始决斗了,请多多指教。", "这次拿到的会是怎样的卡组呢?真是期待。" ], "newturn": [ "我的回合,抽卡!", "我抽了一张卡。" ], "endturn": [ "回合结束。", "我的回合结束了。", "轮到你了。", "开始你的回合吧。" ], "directattack": [ "我使用{0}进行直接攻击。", "你的场上已经空无一物。{0},进行攻击!", "以{0}进行直接攻击。" ], "attack": [ "我使用{0}对{1}进行攻击。", "以{0}对{1}进行攻击!" ], "ondirectattack": [ "唔……", "是{0}的直接攻击吗……真是厉害。", "是否能阻止这次攻击呢……" ], "facedownmonstername": "盖伏的怪兽", "activate": [ "发动{0}。", "发动{0}的效果。", "将{0}的效果发动。" ], "summon": [ "那么,将{0}召唤。", "出来吧,{0}!", "出现吧,{0}!", "召唤{0}。" ], "setmonster": [ "盖伏一只怪兽。", "将一只怪兽盖伏在场上。" ], "chaining": [ "那么,在此连锁发动{0}。", "在此连锁{0}的效果。" ]}
\ No newline at end of file
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