Commit ab8af531 刘韬

1

1 个父辈 16ec6fd9
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
.vscode/* ## Ignore Visual Studio temporary files, build results, and
!.vscode/settings.json ## files generated by popular Visual Studio add-ons.
!.vscode/tasks.json ##
!.vscode/launch.json ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
!.vscode/extensions.json
/.vs/Theme/v16 # User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
\ No newline at end of file \ No newline at end of file
...@@ -201,7 +201,7 @@ namespace Asa.FaceControl ...@@ -201,7 +201,7 @@ namespace Asa.FaceControl
private void CtlText_TextChanged(object sender, EventArgs e) private void CtlText_TextChanged(object sender, EventArgs e)
{ {
//TextChanged?.Invoke(this, new EventArgs()); base.Text = ctlText.Text;
} }
private void CtlText_MouseLeave(object sender, EventArgs e) private void CtlText_MouseLeave(object sender, EventArgs e)
......
...@@ -19,7 +19,7 @@ namespace Asa.FaceControl ...@@ -19,7 +19,7 @@ namespace Asa.FaceControl
public static class Language public static class Language
{ {
private static XmlDocument xmlDoc; private static XmlDocument xmlDoc;
private static string[] filePath; //XML文件的路径 private static string filePath; //XML文件的路径
private static int nameIndex = -1; private static int nameIndex = -1;
//private static readonly Dictionary<string,Dictionary<string, string>> dialogText = new(); //private static readonly Dictionary<string,Dictionary<string, string>> dialogText = new();
private static readonly Dictionary<string, Dictionary<string, ClsLangText>> langForm = new(); private static readonly Dictionary<string, Dictionary<string, ClsLangText>> langForm = new();
...@@ -38,11 +38,11 @@ namespace Asa.FaceControl ...@@ -38,11 +38,11 @@ namespace Asa.FaceControl
/// <param name="path"></param> /// <param name="path"></param>
public static void LoadPath(string path) public static void LoadPath(string path)
{ {
var filePath = System.IO.Directory.GetFiles(path, "*.lngres"); filePath = path;
var files = System.IO.Directory.GetFiles(path, "*.lngres");
foreach (var file in filePath) foreach (var file in files)
{ {
var lngid = Path.GetFileNameWithoutExtension(file); var lngid = Path.GetFileNameWithoutExtension(file);
if (lngid.ToLower() == "en-US".ToLower()) if (lngid.ToLower() == "en-US".ToLower())
{ {
...@@ -51,13 +51,8 @@ namespace Asa.FaceControl ...@@ -51,13 +51,8 @@ namespace Asa.FaceControl
else if (lngid.ToLower() == "zh-CN".ToLower()) else if (lngid.ToLower() == "zh-CN".ToLower())
{ {
Name.Add("简体中文"); Name.Add("简体中文");
} }
if (!File.Exists(file))
return;
langForm.Add(lngid, new Dictionary<string, ClsLangText>()); langForm.Add(lngid, new Dictionary<string, ClsLangText>());
var lngfs = File.ReadAllLines(file); var lngfs = File.ReadAllLines(file);
foreach (var lts in lngfs) foreach (var lts in lngfs)
...@@ -73,7 +68,8 @@ namespace Asa.FaceControl ...@@ -73,7 +68,8 @@ namespace Asa.FaceControl
clsLangText.Font = ConvFont(fnt); clsLangText.Font = ConvFont(fnt);
clsLangText.Name = key; clsLangText.Name = key;
clsLangText.Text = value; clsLangText.Text = value;
langForm[lngid].Add(key, clsLangText); if (!langForm[lngid].ContainsKey(key))
langForm[lngid].Add(key, clsLangText);
} }
} }
LoadLanguage("zh-CN"); LoadLanguage("zh-CN");
...@@ -216,7 +212,7 @@ namespace Asa.FaceControl ...@@ -216,7 +212,7 @@ namespace Asa.FaceControl
{ {
if (cc.Tag == null || cc.Tag.ToString() != "not") if (cc.Tag == null || cc.Tag.ToString() != "not")
{ {
SetNoLangXML(fn, cc.Name, cc.Text); SetNoLangXML(frmname, cc.Name, cc.Text);
} }
} }
} }
...@@ -224,26 +220,19 @@ namespace Asa.FaceControl ...@@ -224,26 +220,19 @@ namespace Asa.FaceControl
SetLang(frmname,cc); SetLang(frmname,cc);
} }
} }
static void SetNoLangXML(string formname,string controlname,string text) { static void SetNoLangXML(string formname, string controlname, string text)
return; {
xmlDoc.Load(filePath[nameIndex]); string att = "";
XmlNode root = xmlDoc.LastChild; if (formname == "Dialog")
var n=root.SelectSingleNode(formname); att = $"{formname}_{controlname}\t{text}\t\t\r\n";
if (n.SelectSingleNode(controlname) != null)
return;
var cc = xmlDoc.CreateComment("原文:"+text);
var ln = xmlDoc.CreateElement(controlname);
if (formname == "Dialog") {
ln.InnerText = text;
}
else else
{ {
ln.SetAttribute("Text", text); if (CurrentLng == "简体中文")
ln.SetAttribute("Font", "微软雅黑,12,,"); att = $"{formname}_{controlname}\t{text}\t\t微软雅黑,12,,\r\n";
else
att = $"{formname}_{controlname}\t{text}\t\tArial,12,,\r\n";
} }
n.AppendChild(cc); File.AppendAllText(Path.Combine(filePath, CurrentLng + ".lngres"), att);
n.AppendChild(ln);
xmlDoc.Save(filePath[nameIndex]);
} }
static bool HasChinese(string txt) static bool HasChinese(string txt)
{ {
...@@ -273,22 +262,22 @@ namespace Asa.FaceControl ...@@ -273,22 +262,22 @@ namespace Asa.FaceControl
return font; return font;
} }
/// <summary> ///// <summary>
/// 转换字体 ///// 转换字体
/// </summary> ///// </summary>
/// <param name="f">字体</param> ///// <param name="f">字体</param>
/// <returns></returns> ///// <returns></returns>
private static string ConvFont(Font f) //private static string ConvFont(Font f)
{ //{
if (f == null) // if (f == null)
return ""; // return "";
string[] s = new string[4]; // string[] s = new string[4];
s[0] = f.Name; // s[0] = f.Name;
s[1] = f.Size.ToString(); // s[1] = f.Size.ToString();
if (f.Bold) s[2] = "B"; // if (f.Bold) s[2] = "B";
if (f.Italic) s[3] = "I"; // if (f.Italic) s[3] = "I";
return string.Join(",", s); // return string.Join(",", s);
} //}
private class ClsLangForm private class ClsLangForm
{ {
......
2f1470bbe825420f40edc7b41de2d5e60240fa72 9da44479a05b444f7188c6cf2697295fd2e64ead07d8aa4cac352316617a99fd
...@@ -121,7 +121,6 @@ D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.FaceControl.PanelBase.resources ...@@ -121,7 +121,6 @@ D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.FaceControl.PanelBase.resources
D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.FaceControl.Resource1.resources D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.FaceControl.Resource1.resources
D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.GenerateResource.cache D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.GenerateResource.cache
D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CoreCompileInputs.cache D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CoreCompileInputs.cache
D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CopyComplete
D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.dll D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.dll
D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.pdb D:\rick\vs\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.pdb
E:\Codes\Neotel\DLL\FaceControl\FaceControl\bin\Debug\Asa.Face.Control.dll E:\Codes\Neotel\DLL\FaceControl\FaceControl\bin\Debug\Asa.Face.Control.dll
...@@ -167,3 +166,4 @@ E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CoreCom ...@@ -167,3 +166,4 @@ E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CoreCom
E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CopyComplete E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\FaceControl.csproj.CopyComplete
E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.dll E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.dll
E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.pdb E:\Codes\Neotel\DLL\FaceControl\FaceControl\obj\Debug\Asa.Face.Control.pdb
D:\rick\vs\FaceControl\FaceControl\obj\Debug\FaceCont.0A9DC786.Up2Date
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!