📄 resx.cs
字号:
namespace Lion.Data.Library.HtmlEditor.Core
{
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Resources;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Security.Permissions;
[StrongNameIdentityPermission(SecurityAction.LinkDemand,Name="Lion.Data.Library.HtmlEditor",PublicKey="0x0024000004800000940000000602000000240000525341310004000001000100630BF2344DC03AE77DB7E7B1F7AFFFAD4ABC2847A113EDA3DC8CBF725A4B5F15260BCB76EFACACB3FA7168B589E0E5AACFB9C246DB17CA0913A3FF0E93503D6EB6C1031E1E7511807A52FDA4DDA5D9F423D46E71BA4E72D54A85CE81A46C9D6ADA6D15493844A1B5A70E2B6E7287274C79FF13FDD6736F51A048DD44B0FD90D1")]
internal class Resx
{
static Hashtable _asmfiles;
static public byte[] LoadAssemblyFiles(string filename)
{
if(filename==null)
throw(new ArgumentNullException("filename"));
if(!filename.StartsWith("/"))
throw(new ArgumentException("must starts with '/'","filename"));
filename="/"+filename.Remove(0,1).Replace('/','.');
if(_asmfiles==null)
{
Hashtable afs=new Hashtable();
foreach(string resname in typeof(Resx).Assembly.GetManifestResourceNames())
{
if(!resname.StartsWith("Lion.Data.Library.HtmlEditor.Files."))
continue;
string fn="/"+resname.Remove(0,"Lion.Data.Library.HtmlEditor.Files.".Length);
fn=fn.ToLower();
byte[] buf;
using(Stream s=typeof(Resx).Assembly.GetManifestResourceStream(resname))
{
buf=new byte[s.Length];
s.Read(buf,0,buf.Length);
}
afs.Add(fn,buf);
}
_asmfiles=afs;
}
return (byte[])_asmfiles[filename.ToLower()];
}
static internal Hashtable _files=new Hashtable();
static public byte[] LoadFile(string filename)
{
if(filename==null)throw(new ArgumentNullException("filename"));
string key=CultureInfo.CurrentUICulture+":"+CultureInfo.CurrentCulture.ToString()+":"+filename;
key=key.ToLower();
if(_files.Contains(key))
return (byte[])_files[key];
byte[] bs=null;
if(bs==null)
{
bs=(byte[])LoadAssemblyFiles(filename);
}
_files[key]=bs;
return bs;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -