本文整理汇总了C#中StringTable类的典型用法代码示例。如果您正苦于以下问题:C# StringTable类的具体用法?C# StringTable怎么用?C# StringTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringTable类属于命名空间,在下文中一共展示了StringTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
public string GetValue()
{
StringTable table = new StringTable();
//table.Add("LimitType", LimitType.ToString());
table.Add("LimitType", ((byte)LimitType).ToString());
foreach (KeyValuePair<Guid, List<Guid>> item in ExcludeRoles)
{
if (item.Value != null)
{
StringList roles = new StringList();
foreach (Guid roleID in item.Value)
{
roles.Add(roleID.ToString());
}
table.Add("ExcludeRoles-" + item.Key.ToString("N"), roles.ToString());
}
}
return table.ToString();
}
示例2: LoadConverTable
void LoadConverTable()
{
cont_String = new Dictionary<string, TB_Conversation>();
StringTable st = new StringTable();
if (false == st.Build("Table/TB_Conversation")) { return; }
int iRowCount = st.row;
for (int x = 0; x < iRowCount; ++x)
{
TB_Conversation tbString = new TB_Conversation();
tbString.mStringNo = st.GetValueAsInt(x, "NPCNo");
tbString.mScenarioNo= st.GetValueAsInt(x, "ScenarioNo");
tbString.stString = st.GetValue(x, "String");
string key = tbString.mStringNo.ToString() + "_" + tbString.mScenarioNo.ToString();
if (cont_String.ContainsKey(key))
{
Debug.LogError("Already exist key. " + key.ToString());
}
cont_String.Add(key, tbString);
}
}
示例3: DBCReader
public DBCReader(string fileName)
{
using (var reader = BinaryReaderExtensions.FromFile(fileName))
{
if (reader.BaseStream.Length < HeaderSize)
{
throw new InvalidDataException(String.Format("File {0} is corrupted!", fileName));
}
if (reader.ReadUInt32() != DBCFmtSig)
{
throw new InvalidDataException(String.Format("File {0} isn't valid DBC file!", fileName));
}
RecordsCount = reader.ReadInt32();
FieldsCount = reader.ReadInt32();
RecordSize = reader.ReadInt32();
StringTableSize = reader.ReadInt32();
m_rows = new byte[RecordsCount][];
for (int i = 0; i < RecordsCount; i++)
m_rows[i] = reader.ReadBytes(RecordSize);
int stringTableStart = (int)reader.BaseStream.Position;
StringTable = new StringTable();
while (reader.BaseStream.Position != reader.BaseStream.Length)
{
int index = (int)reader.BaseStream.Position - stringTableStart;
StringTable[index] = reader.ReadStringNull();
}
}
}
示例4: frmCsfEntryEdit
public frmCsfEntryEdit(StringTable st)
{
InitializeComponent();
translateData = st;
LanguageParser.ParseLanguage(st, this);
}
示例5: Udl
public Udl()
{
mUdlHeadstream = new UdlHeadstream();
mStringTable = new StringTable();
m_tUflCreate = null;
m_tUflLoad = null;
}
示例6: Parse
public static ExtendedFieldSearchInfo Parse(StringTable values)
{
ExtendedFieldSearchInfo result = new ExtendedFieldSearchInfo();
ExtendedField[] fileds = AllSettings.Current.ExtendedFieldSettings.FieldsWithPassport.ToArray();
foreach (DictionaryEntry item in values)
{
if (item.Value == null || (string)item.Value == string.Empty)
continue;
ExtendedField field = Array.Find<ExtendedField>(fileds, match => match.Key == (string)item.Key);
if (field != null)
{
ExtendedFieldType type = UserBO.Instance.GetExtendedFieldType(field.FieldTypeName);
if (type != null)
{
if (result.Items == null)
result.Items = new List<ExtendedFieldSearchInfoItem>();
result.Items.Add(new ExtendedFieldSearchInfoItem((string)item.Key, (string)item.Value, type.NeedExactMatch));
}
}
}
return result;
}
示例7: ExtendedFieldSettings
public ExtendedFieldSettings()
{
Version = string.Empty;
Fields = new ExtendedFieldCollection();
PassportSorts = new StringTable();
IsEnables = new StringTable();
}
示例8: LoadString
public void LoadString(string key, StringTable.Language language, StringTable.Platform platform, string translation)
{
foreach( StringTableEntry entry in m_tables )
{
if( entry.language == language && entry.platform == platform )
{
entry.table.LoadString( key, translation );
}
}
}
示例9: Constructor_NoStringTable_NoItemsLoaded
public void Constructor_NoStringTable_NoItemsLoaded()
{
// Act
_stringTable = new StringTable(_stringTableFiles, DefaultLanguage, _languageManagerProvider.Object, _fileReader.Object);
_stringTable.Setup();
// Assert
Assert.AreEqual(0, ((IDictionary<string, object>)_stringTable.Items).Count);
}
示例10: DB2Reader
public DB2Reader(string fileName)
{
using (var reader = BinaryReaderExtensions.FromFile(fileName))
{
if (reader.BaseStream.Length < HeaderSize)
{
throw new InvalidDataException(String.Format("File {0} is corrupted!", fileName));
}
if (reader.ReadUInt32() != DB2FmtSig)
{
throw new InvalidDataException(String.Format("File {0} isn't valid DBC file!", fileName));
}
RecordsCount = reader.ReadInt32();
FieldsCount = reader.ReadInt32();
RecordSize = reader.ReadInt32();
StringTableSize = reader.ReadInt32();
// WDB2 specific fields
uint tableHash = reader.ReadUInt32(); // new field in WDB2
uint build = reader.ReadUInt32(); // new field in WDB2
int unk1 = reader.ReadInt32(); // new field in WDB2
if (build > 12880) // new extended header
{
int unk2 = reader.ReadInt32(); // new field in WDB2
int unk3 = reader.ReadInt32(); // new field in WDB2 (index table?)
int locale = reader.ReadInt32(); // new field in WDB2
int unk5 = reader.ReadInt32(); // new field in WDB2
if (unk3 != 0)
{
reader.ReadBytes(unk3 * 4 - HeaderSize); // an index for rows
reader.ReadBytes(unk3 * 2 - HeaderSize * 2); // a memory allocation bank
}
}
m_rows = new byte[RecordsCount][];
for (int i = 0; i < RecordsCount; i++)
m_rows[i] = reader.ReadBytes(RecordSize);
int stringTableStart = (int)reader.BaseStream.Position;
StringTable = new StringTable();
while (reader.BaseStream.Position != reader.BaseStream.Length)
{
int index = (int)reader.BaseStream.Position - stringTableStart;
StringTable[index] = reader.ReadStringNull();
}
}
}
示例11: DB2Reader
public DB2Reader(string fileName)
{
using (var reader = BinaryReaderExtensions.FromFile(fileName))
{
if (reader.BaseStream.Length < HeaderSize)
{
Console.WriteLine("File {0} is corrupted!", fileName);
return;
}
var signature = reader.ReadUInt32();
if (signature != DB2FmtSig && signature != ADBFmtSig)
{
Console.WriteLine("File {0} isn't valid DBC file!", fileName);
return;
}
RecordsCount = reader.ReadInt32();
FieldsCount = reader.ReadInt32(); // not fields count in WCH2
RecordSize = reader.ReadInt32();
StringTableSize = reader.ReadInt32();
// WDB2/WCH2 specific fields
uint tableHash = reader.ReadUInt32(); // new field in WDB2
uint build = reader.ReadUInt32(); // new field in WDB2
int unk1 = reader.ReadInt32(); // new field in WDB2 (Unix time in WCH2)
int unk2 = reader.ReadInt32(); // new field in WDB2
int unk3 = reader.ReadInt32(); // new field in WDB2 (index table?)
int locale = reader.ReadInt32(); // new field in WDB2
int unk5 = reader.ReadInt32(); // new field in WDB2
if (unk3 != 0)
{
reader.ReadBytes(unk3 * 4 - HeaderSize); // an index for rows
reader.ReadBytes(unk3 * 2 - HeaderSize * 2); // a memory allocation bank
}
m_rows = new byte[RecordsCount][];
for (int i = 0; i < RecordsCount; i++)
m_rows[i] = reader.ReadBytes(RecordSize);
int stringTableStart = (int)reader.BaseStream.Position;
StringTable = new StringTable();
while (reader.BaseStream.Position != reader.BaseStream.Length)
{
int index = (int)reader.BaseStream.Position - stringTableStart;
StringTable[index] = reader.ReadStringNull();
}
}
}
示例12: CompilationContext
public CompilationContext(HostCallTable hostCallTable,
StringTable stringTable,
EnumDefineTable enumTable,
TypeBindingTable typeBindingTable,
EventBindingTable eventBindingTable)
{
m_HostCallTable = hostCallTable;
m_StringTable = stringTable;
m_EnumTable = enumTable;
m_TypeBindingTable = typeBindingTable;
m_EventBindingTable = eventBindingTable;
}
示例13: CacheFile
public CacheFile(string Filename, string Build)
: base(Filename, Build)
{
Version = DefinitionSet.Halo1AE;
Header = new CacheH1P.CacheHeader(this);
IndexHeader = new CacheH1P.CacheIndexHeader(this);
IndexItems = new CacheH1P.IndexTable(this);
Strings = new StringTable(this);
LocaleTables = new List<LocaleTable>();
}
示例14: Constructor_StringTableFound_ItemsLoadedCorrectly
public void Constructor_StringTableFound_ItemsLoadedCorrectly()
{
// Assign
_fileReader.Setup(x => x.LoadXDocument(It.IsAny<string>())).Returns(XDocument.Parse("<?xml version=\"1.0\" encoding=\"utf-8\" ?><items><item name=\"SiteTitle\" value=\"Your site title!\" /></items>"));
// Act
_stringTable = new StringTable(_stringTableFiles, DefaultLanguage, _languageManagerProvider.Object, _fileReader.Object);
_stringTable.Setup();
// Assert
Assert.AreEqual("Your site title!", _stringTable.Items.SiteTitle);
}
示例15: ToString
public override string ToString()
{
StringTable values = new StringTable();
if (Items != null)
{
foreach (ExtendedFieldSearchInfoItem item in Items)
{
values.Add(item.FieldKey, item.SearchValue);
}
}
return values.ToString();
}