mirror of
https://github.com/nsnail/dot.git
synced 2025-06-19 22:08:16 +08:00
<chore> + 增加t4模板自动生成resx.designer.cs
This commit is contained in:
86
src/Lang/Str.tt
Normal file
86
src/Lang/Str.tt
Normal file
@ -0,0 +1,86 @@
|
||||
<#@ template language="C#" #>
|
||||
<#@ import namespace="System.Xml" #>
|
||||
<#@ assembly name="System.Xml" #>
|
||||
<#@ output encoding="utf-8" extension="Designer.cs" #>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Dot.Lang {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Str {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Str() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Dot.Lang.Str", typeof(Str).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
var xml = new XmlDocument();
|
||||
xml.Load("Str.resx");
|
||||
foreach (XmlNode data in xml.SelectNodes("//root/data")) {
|
||||
#>
|
||||
/// <summary>
|
||||
/// <#= data.SelectSingleNode("value").InnerText #>
|
||||
/// </summary>
|
||||
public static string <#= data.Attributes["name"].Value #> {
|
||||
get {
|
||||
return ResourceManager.GetString("<#= data.Attributes["name"].Value #>", resourceCulture);
|
||||
}
|
||||
}
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user