本文整理汇总了C#中IValueWriter.WriteMany方法的典型用法代码示例。如果您正苦于以下问题:C# IValueWriter.WriteMany方法的具体用法?C# IValueWriter.WriteMany怎么用?C# IValueWriter.WriteMany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueWriter
的用法示例。
在下文中一共展示了IValueWriter.WriteMany方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveGrhs
/// <summary>
/// Writes all the MapGrhs to an <see cref="IValueWriter"/>.
/// </summary>
/// <param name="w">IValueWriter to write to.</param>
void SaveGrhs(IValueWriter w)
{
w.WriteStartNode(_mapGrhsNodeName);
{
// Used GrhIndexes
w.WriteMany(_usedIndiciesNodeName, GetMapGrhList(), w.Write);
// MapGrhs
w.WriteManyNodes(_mapGrhsNodeName, Spatial.GetMany<MapGrh>().Distinct(),
((writer, item) => item.WriteState(writer)));
}
w.WriteEndNode(_mapGrhsNodeName);
}
示例2: WriteToolBarItems
/// <summary>
/// Writes the items in a <see cref="ToolBar"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
/// <param name="tb">The <see cref="ToolBar"/> containing the items to write.</param>
static void WriteToolBarItems(IValueWriter writer, ToolBar tb)
{
var tbItems = tb.GetItems().Select(x => x == null ? _separatorClassName : (GetToolKey(x.Tool) ?? _separatorClassName));
writer.WriteEnum(_toolBarItemsKeyName, tb.ToolBarVisibility);
writer.WriteMany(_toolBarItemsValueName, tbItems, writer.Write);
}
示例3: Write
/// <summary>
/// Writes the NPCChatDialogItemBase's values to an IValueWriter.
/// </summary>
/// <param name="writer">IValueWriter to write the values to.</param>
public void Write(IValueWriter writer)
{
writer.Write("Value", Value);
writer.Write("Page", Page);
writer.Write("Text", Text ?? string.Empty);
writer.WriteMany("Actions", Actions.Select(x => x.Name), writer.Write);
writer.WriteStartNode("Conditionals");
{
var c = Conditionals;
var hasConditionals = (c != null) && (!c.IsEmpty());
writer.Write("HasConditionals", hasConditionals);
if (hasConditionals)
c.Write(writer);
}
writer.WriteEndNode("Conditionals");
}
示例4: WriteCustomValues
/// <summary>
/// When overridden in the derived class, writes the values unique to this derived type to the
/// <paramref name="writer"/>.
/// </summary>
/// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
protected override void WriteCustomValues(IValueWriter writer)
{
var frameIndices = _frames.Select(x => x.GrhIndex).ToArray();
writer.Write(_speedValueKey, (int)(1f / Speed));
writer.WriteMany(_framesNodeName, frameIndices, writer.Write);
}