本文整理汇总了C#中StringTable.Add方法的典型用法代码示例。如果您正苦于以下问题:C# StringTable.Add方法的具体用法?C# StringTable.Add怎么用?C# StringTable.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringTable
的用法示例。
在下文中一共展示了StringTable.Add方法的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: 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();
}
示例3: SaveList
private void SaveList()
{
StringTable passportSorts = new StringTable();
StringTable passportEnables = new StringTable();
string keys = _Request.Get("extendfieldEnable", Method.Post,string.Empty);
List<string> enableKeys = StringUtil.Split2<string>(keys);
ExtendedFieldSettings fieldSetting = SettingManager.CloneSetttings<ExtendedFieldSettings>(AllSettings.Current.ExtendedFieldSettings);
ExtendedFieldCollection fields = new ExtendedFieldCollection();
foreach (ExtendedField field in fieldSetting.FieldsWithPassport)
{
int sortOrder = _Request.Get<int>(field.Key + "_sortOrder", Method.Post, 0);;
if (field.IsPassport)
{
passportSorts.Add(field.Key, sortOrder.ToString());
if (enableKeys.Contains(field.Key) == false)
passportEnables.Add(field.Key, "0");
//field.SortOrder = sortOrder;
}
else
{
field.SortOrder = sortOrder;
fields.Add(field);
}
}
fieldSetting.Fields = fields;
fieldSetting.PassportSorts = passportSorts;
fieldSetting.IsEnables = passportEnables;
SettingManager.SaveSettings(fieldSetting);
UserBO.Instance.RemoveAllUserCache();
}
示例4: ParseStringTable
public static StringTable ParseStringTable(string value)
{
StringTable result = new StringTable();
int endOfHeader = value.IndexOf('|');
string header = value.Substring(0, endOfHeader);
string values = value.Substring(endOfHeader + 1);
int endOfItem = -1;
int valueCursor = 0;
while (true)
{
int endOfOldItem = endOfItem + 1;
endOfItem = header.IndexOf(';', endOfItem + 1);
if (endOfItem < 0)
break;
int endOfItemName = header.IndexOf(',', endOfOldItem + 1, endOfItem - endOfOldItem - 1);
string itemName = header.Substring(endOfOldItem, endOfItemName - endOfOldItem);
int itemLength = int.Parse(header.Substring(endOfItemName + 1, endOfItem - endOfItemName - 1));
string itemValue = values.Substring(valueCursor, itemLength);
valueCursor += itemLength;
result.Add(itemName, itemValue);
}
return result;
}
示例5: GetStrings
internal override void GetStrings(StringTable table)
{
table.Add(Name);
foreach (MDL0GroupNode n in Children)
n.GetStrings(table);
_hasOpa = _hasXlu = false;
if (_matList != null)
foreach (MDL0MaterialNode n in _matList)
if (n.XLUMaterial)
_hasXlu = true;
else
_hasOpa = true;
//Add def names
if (_hasTree) table.Add("NodeTree");
if (_hasMix) table.Add("NodeMix");
if (_hasOpa) table.Add("DrawOpa");
if (_hasXlu) table.Add("DrawXlu");
if (_version > 9)
foreach (UserDataClass s in _userEntries)
{
table.Add(s._name);
if (s._type == UserValueType.String && s._entries.Count > 0)
table.Add(s._entries[0]);
}
if (!String.IsNullOrEmpty(_originalPath))
table.Add(_originalPath);
}
示例6: GetStrings
internal override void GetStrings(StringTable table)
{
if (Name != "<null>")
table.Add(Name);
foreach (UserDataClass s in _userEntries)
{
table.Add(s._name);
if (s._type == UserValueType.String && s._entries.Count > 0)
table.Add(s._entries[0]);
}
}
示例7: GetStrings
internal override void GetStrings(StringTable table)
{
table.Add(Name);
foreach (UserDataClass s in _userEntries)
{
table.Add(s._name);
if (s._type == UserValueType.String && s._entries.Count > 0)
table.Add(s._entries[0]);
}
foreach (MDL0MaterialRefNode n in Children)
n.GetStrings(table);
}
示例8: GetExtendData
public static string GetExtendData(bool isClosed, int reward, int rewardCount, bool alwaysEyeable, DateTime expiresDate, int bestPostID, int unusefulCount, int usefulCount, Dictionary<int,int> rewards)
{
StringTable table = new StringTable();
table.Add("IsClosed", isClosed ? "1" : "0");
table.Add("reward", reward.ToString());
table.Add("rewardCount", rewardCount.ToString());
table.Add("alwaysEyeable", alwaysEyeable.ToString());
table.Add("expiresDate", expiresDate.ToString());
table.Add("bestPostID", bestPostID.ToString());
table.Add("unusefulCount", unusefulCount.ToString());
table.Add("usefulCount", usefulCount.ToString());
if (rewards == null)
rewards = new Dictionary<int, int>();
table.Add("rewardPostIDs", StringUtil.Join(rewards.Keys));
table.Add("rewards", StringUtil.Join(rewards.Values));
return table.ToString();
}
示例9: LoadSettingsFromRequest
public override StringTable LoadSettingsFromRequest()
{
StringTable table = new StringTable();
table.Add("data", @"北京市
-北京市
--东城区
--西城区
--崇文区
--宣武区
--朝阳区
--丰台区
--石景山区
--海淀区
--门头沟区
--房山区
--通州区
--顺义区
--昌平区
--大兴区
--怀柔区
--平谷区
--密云县
--延庆县
天津市
-天津市
--和平区
--河东区
--河西区
--南开区
--河北区
--红桥区
--塘沽区
--汉沽区
--大港区
--东丽区
--西青区
--津南区
--北辰区
--武清区
--宝坻区
--宁河县
--静海县
--蓟县
河北省
-石家庄市
--长安区
--桥东区
--桥西区
--新华区
--井陉矿区
--裕华区
--井陉县
--正定县
--栾城县
--行唐县
--灵寿县
--高邑县
--深泽县
--赞皇县
--无极县
--平山县
--元氏县
--赵县
--辛集市
--藁城市
--晋州市
--新乐市
--鹿泉市
-唐山市
--路南区
--路北区
--古冶区
--开平区
--丰南区
--丰润区
--滦县
--滦南县
--乐亭县
--迁西县
--玉田县
--唐海县
--遵化市
--迁安市
-秦皇岛市
--海港区
--山海关区
--北戴河区
--青龙满族自治县
--昌黎县
--抚宁县
--卢龙县
-邯郸市
--邯山区
--丛台区
--复兴区
--峰峰矿区
--邯郸县
//.........这里部分代码省略.........
示例10: GetStrings
internal override void GetStrings(StringTable table)
{
table.Add(Name);
foreach (CLR0MaterialNode n in Children)
table.Add(n.Name);
if (_version == 4)
foreach (UserDataClass s in _userEntries)
{
table.Add(s._name);
if (s._type == UserValueType.String && s._entries.Count > 0)
table.Add(s._entries[0]);
}
if (!String.IsNullOrEmpty(_originalPath))
table.Add(_originalPath);
}
示例11: JoinForum
private void JoinForum()
{
int oldForumID = Forum.ForumID;
int newForumID = _Request.Get<int>("targetForum", Method.Post, 0);
MessageDisplay msgDisplay = CreateMessageDisplay();
if (oldForumID == newForumID)
{
msgDisplay.AddError("不能合并到本身");
return;
}
bool beginTask = false;
using (new ErrorScope())
{
StringTable keyValues = new StringTable();
keyValues.Add("oldForumID", oldForumID.ToString());
keyValues.Add("newForumID", newForumID.ToString());
try
{
beginTask = TaskManager.BeginTask(MyUserID, new JoinForumTask(), keyValues.ToString());
}
catch (Exception ex)
{
msgDisplay.AddException(ex);
}
}
if (beginTask)
Return(true);
}
示例12: GetExtendData
public static string GetExtendData(string agreeViewPoint, string againstViewPoint, int agreeCount, int againstCount, int neutralCount, DateTime expiresDate, Dictionary<int,ViewPointType> polemizeUsers)
{
StringTable table = new StringTable();
table.Add("agreeViewPoint", agreeViewPoint);
table.Add("againstViewPoint",againstViewPoint);
table.Add("agreeCount", agreeCount.ToString());
table.Add("againstCount", againstCount.ToString());
table.Add("neutralCount", neutralCount.ToString());
table.Add("expiresDate", expiresDate.ToString());
if (polemizeUsers == null)
polemizeUsers = new Dictionary<int, ViewPointType>();
table.Add("polemizeUserIDs", StringUtil.Join(polemizeUsers.Keys));
StringBuilder sb = new StringBuilder();
foreach (ViewPointType pointType in polemizeUsers.Values)
{
sb.Append((int)pointType);
sb.Append(",");
}
string value;
if (sb.Length > 0)
value = sb.ToString(0, sb.Length - 1);
else
value = string.Empty;
table.Add("polemizeViewPointTypes", value);
return table.ToString();
}
示例13: GetStrings
internal override void GetStrings(StringTable table)
{
if (Name != "<null>")
table.Add(Name);
else return;
if (_ambient != null && !String.IsNullOrEmpty(_ambient.Name))
table.Add(_ambient.Name);
for (int i = 0; i < 8; i++)
if (!String.IsNullOrEmpty(GetLightName(i)))
table.Add(GetLightName(i));
}
示例14: GetStrings
internal virtual void GetStrings(StringTable table)
{
table.Add(Name);
}
示例15: GetStrings
internal override void GetStrings(StringTable table)
{
table.Add(Name);
if (_palette != null)
table.Add(_palette.Name);
}