• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# StringTable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中StringTable的典型用法代码示例。如果您正苦于以下问题:C# StringTable类的具体用法?C# StringTable怎么用?C# StringTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringTable类属于命名空间,在下文中一共展示了StringTable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:28,代码来源:PermissionLimit.cs


示例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);
        }
    }
开发者ID:yabos,项目名称:BattleHit,代码行数:27,代码来源:TBManager.cs


示例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();
                }
            }
        }
开发者ID:Gintama,项目名称:VoragineTools,代码行数:35,代码来源:DBCReader.cs


示例4: frmCsfEntryEdit

        public frmCsfEntryEdit(StringTable st)
        {
            InitializeComponent();

            translateData = st;
            LanguageParser.ParseLanguage(st, this);
        }
开发者ID:yuri410,项目名称:lrvbsvnicg,代码行数:7,代码来源:frmCsfEntryEdit.cs


示例5: Udl

 public Udl()
 {
     mUdlHeadstream = new UdlHeadstream();
     mStringTable = new StringTable();
     m_tUflCreate = null;
     m_tUflLoad = null;
 }
开发者ID:zyouhua,项目名称:weilai,代码行数:7,代码来源:Udl.cs


示例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;
		}
开发者ID:huchao007,项目名称:bbsmax,代码行数:29,代码来源:ExtendedFieldSearchInfo.cs


示例7: ExtendedFieldSettings

		public ExtendedFieldSettings()
		{
			Version = string.Empty;
			Fields = new ExtendedFieldCollection();
            PassportSorts = new StringTable();
            IsEnables = new StringTable();
		}
开发者ID:huchao007,项目名称:bbsmax,代码行数:7,代码来源:ExtendedFieldSettings.cs


示例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 );
         }
     }
 }
开发者ID:eddaly,项目名称:elvis,代码行数:10,代码来源:StringTableImporter.cs


示例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);
        }
开发者ID:jmptrader,项目名称:AcspNet,代码行数:10,代码来源:StringTableTests.cs


示例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();
                }
            }
        }
开发者ID:kainwinterheart,项目名称:dbc2html,代码行数:55,代码来源:DB2Reader.cs


示例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();
                }
            }
        }
开发者ID:arkanoid1,项目名称:mywowtools,代码行数:55,代码来源:DB2Reader.cs


示例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;
 }
开发者ID:RainsSoft,项目名称:GossipScript,代码行数:12,代码来源:CompilationContext.cs


示例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>();
        }
开发者ID:PersonalityPi,项目名称:HaloOnlineTagTool,代码行数:12,代码来源:CacheFile.cs


示例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);
        }
开发者ID:jmptrader,项目名称:AcspNet,代码行数:13,代码来源:StringTableTests.cs


示例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();
		}
开发者ID:huchao007,项目名称:bbsmax,代码行数:14,代码来源:ExtendedFieldSearchInfo.cs


示例16: Constructor_CurrentLanguageEqualToDefaultLanguage_DefaultItemsNotLoaded

        public void Constructor_CurrentLanguageEqualToDefaultLanguage_DefaultItemsNotLoaded()
        {
            // Assign

            _languageManager.SetupGet(x => x.Language).Returns("en");
            _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
            _fileReader.Verify(x => x.LoadXDocument(It.IsAny<string>(), It.IsAny<string>()), Times.Never);
        }
开发者ID:jmptrader,项目名称:AcspNet,代码行数:15,代码来源:StringTableTests.cs


示例17: Update

        public void Update(StringTable table, int numEntries, byte[] data)
        {
            using (var stream = Bitstream.CreateWith(data))
            {
                var option = stream.ReadBool();
                if (option)
                {
                    throw new ArgumentException("Unknown option " + option);
                }

                var keyHistory = new List<string>();

                var entryId = uint.MaxValue;
                uint read = 0;

                while (read < numEntries)
                {
                    if (!stream.ReadBool())
                    {
                        entryId = stream.ReadBits(table.EntryBits);
                    }
                    else
                    {
                        entryId = unchecked(entryId + 1);
                    }

                    var key = ReadKeyIfIncluded(stream, keyHistory);
                    var value = ReadValueIfIncluded(stream, table.UserDataFixedSize,
                        table.UserDataSizeBits);

                    if (entryId < table.Count)
                    {
                        var entry = table.Get(entryId);

                        if (value != null)
                        {
                            entry.Value = value;
                        }
                    }
                    else
                    {
                        table.Put(entryId, new StringTable.Entry(key, value));
                    }

                    ++read;
                }
            }
        }
开发者ID:noxor0,项目名称:Dota2,代码行数:48,代码来源:StringTableUpdater.cs


示例18: Intro

        public override void Intro( params object [] args )
        {
            contentManager = new ResourceTable ( FileSystemManager.GetFileSystem ( FileSystemManager.ManifestFileSystem ) );

            Core.GraphicsDevice.ImmediateContext.BlendState = BlendState.AlphaBlend;
            Add ( InputHelper.Instance );

            stt = contentManager.Load<StringTable> ( "Resources/stringTable.json" );

            font = contentManager.Load<TrueTypeFont> ( "Resources/test.ttf", 22 );
            font.IsPrerenderMode = true;
            font2 = contentManager.Load<TrueTypeFont> ( "Resources/test.ttf", 32 );
            font2.SeconaryFont = contentManager.Load<TrueTypeFont> ( "Resources/segoeui.ttf", 32 );

            base.Intro ( args );
        }
开发者ID:Daramkun,项目名称:Misty,代码行数:16,代码来源:Container.cs


示例19: Export

        public unsafe override void Export(string outPath)
        {
            StringTable table = new StringTable();
            table.Add(_name);

            int dataLen = OnCalculateSize(true);
            int totalLen = dataLen + table.GetTotalSize();

            using (FileStream stream = new FileStream(outPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 8, FileOptions.RandomAccess))
            {
                stream.SetLength(totalLen);
                using (FileMap map = FileMap.FromStream(stream))
                {
                    AnimationConverter.EncodeCHR0Keyframes(Keyframes, map.Address, map.Address + _entryLen);
                    table.WriteTable(map.Address + dataLen);
                    PostProcess(map.Address, table);
                }
            }
        }
开发者ID:blahblahblahblah831,项目名称:brawltools2,代码行数:19,代码来源:CHR0Node.cs


示例20: button1_Click

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            StringTable gender = new StringTable();
            gender.setIndexes(
                StringTableEntry.NumericCode,
                StringTableEntry.LetterCode,
                StringTableEntry.FullText,
                "requireSecondOfficer"
                );
            gender.addItem("1", "m", "Male", "false");
            gender.addItem("2", "f", "Female", "true");
            gender.addItem("99", "u", "Unknown", "true");

            gender["Male", StringTableEntry.FullText][StringTableEntry.NumericCode] = "3";

            int value = int.Parse(gender["Male", StringTableEntry.FullText][StringTableEntry.NumericCode]); //retrieve numeric code for a Male

            StringTable bob = new StringTable();

            MessageBox.Show(value.ToString());
        }
开发者ID:FlyingPotatoes,项目名称:TestRepo,代码行数:21,代码来源:MainWindow.xaml.cs



注:本文中的StringTable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# StringTemplate类代码示例发布时间:2022-05-24
下一篇:
C# StringSplitOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap