📄 appdictionary.cs
字号:
namespace Imps.Client.Resource
{
using Imps.Client;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Xml;
public class AppDictionary : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable
{
private static AppDictionary _appDic = new AppDictionary();
private static Dictionary<string, string> _dic = null;
private const string _rootNodeName = "AppDictionary";
public AppDictionary()
{
_dic = new Dictionary<string, string>();
this.Init();
}
public void Add(KeyValuePair<string, string> item)
{
throw new Exception("The method or operation is not implemented.");
}
public void Add(string key, string value)
{
throw new Exception("The method or operation is not implemented.");
}
public void Clear()
{
throw new Exception("The method or operation is not implemented.");
}
public bool Contains(KeyValuePair<string, string> item)
{
throw new NotImplementedException();
}
public bool ContainsKey(string key)
{
return _dic.ContainsKey(key);
}
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
{
throw new Exception("The method or operation is not implemented.");
}
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return this.GetEnumerator();
}
public void Init()
{
try
{
XmlDocument document = new XmlDocument();
document.Load(ImpsResources.GetResourceStream("AppDictionary.xml"));
foreach (XmlNode node2 in document.DocumentElement.SelectSingleNode("AppDictionary").ChildNodes)
{
_dic.Add(node2.Attributes["key"].Value, node2.Attributes["value"].Value);
}
}
catch
{
}
}
public bool Remove(KeyValuePair<string, string> item)
{
throw new Exception("The method or operation is not implemented.");
}
public bool Remove(string key)
{
throw new Exception("The method or operation is not implemented.");
}
IEnumerator IEnumerable.GetEnumerator()
{
return _dic.GetEnumerator();
}
public bool TryGetValue(string key, out string value)
{
return _dic.TryGetValue(key, ref value);
}
public static string BizName
{
get
{
return _dic.get_Item("BizName");
}
}
public static string CarrierPortal
{
get
{
return _dic.get_Item("CarrierPortal");
}
}
public int Count
{
get
{
return _dic.get_Count();
}
}
public static string CurrentClientName
{
get
{
return _dic.get_Item("PcClientName");
}
}
public static string ExServiceEnglishName
{
get
{
return _dic.get_Item("ExServiceEnglishName");
}
}
public static string ExServiceLocalName
{
get
{
return _dic.get_Item("ExServiceLocalName");
}
}
public static string FullEnglishName
{
get
{
return _dic.get_Item("FullEnglishName");
}
}
public static string FullLocalName
{
get
{
return _dic.get_Item("FullLocalName");
}
}
public static AppDictionary Instance
{
get
{
return _appDic;
}
}
public bool IsReadOnly
{
get
{
return true;
}
}
public string this[string key]
{
get
{
return _dic.get_Item(key);
}
set
{
throw new Exception("The method or operation is not implemented.");
}
}
public ICollection<string> Keys
{
get
{
return _dic.get_Keys();
}
}
public static string MatchServiceLocalName
{
get
{
return _dic.get_Item("MatchServiceLocalName");
}
}
public static string OtherServiceLocalName
{
get
{
return _dic.get_Item("OtherServiceLocalName");
}
}
public static string ShareContentFolderName
{
get
{
return _dic.get_Item("ShareContentFolderName");
}
}
public static string ShortEnglishName
{
get
{
return _dic.get_Item("ShortEnglishName");
}
}
public static string ShortLocalName
{
get
{
return _dic.get_Item("ShortLocalName");
}
}
public static string SidLocalName
{
get
{
return _dic.get_Item("SidLocalName");
}
}
public ICollection<string> Values
{
get
{
return _dic.get_Values();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -