本文整理汇总了C#中WidgetArgs.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# WidgetArgs.ContainsKey方法的具体用法?C# WidgetArgs.ContainsKey怎么用?C# WidgetArgs.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WidgetArgs
的用法示例。
在下文中一共展示了WidgetArgs.ContainsKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadWidget
public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
{
var widget = NewWidget(node.Key, args);
if (parent != null)
parent.AddChild( widget );
if (node.Key.Contains("@"))
FieldLoader.LoadField(widget, "Id", node.Key.Split('@')[1]);
foreach (var child in node.Value.Nodes)
if (child.Key != "Children")
FieldLoader.LoadField(widget, child.Key, child.Value.Value);
if (!args.ContainsKey("modRules"))
args = new WidgetArgs(args) { { "modRules", modData.DefaultRules } };
widget.Initialize(args);
foreach (var child in node.Value.Nodes)
if (child.Key == "Children")
foreach (var c in child.Value.Nodes)
LoadWidget( args, widget, c);
widget.PostInit(args);
return widget;
}
示例2: LoadWidget
public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
{
if (!args.ContainsKey("modData"))
args = new WidgetArgs(args) { { "modData", modData } };
var widget = NewWidget(node.Key, args);
if (parent != null)
parent.AddChild(widget);
if (node.Key.Contains("@"))
FieldLoader.LoadField(widget, "Id", node.Key.Split('@')[1]);
foreach (var child in node.Value.Nodes)
if (child.Key != "Children")
FieldLoader.LoadField(widget, child.Key, child.Value.Value);
widget.Initialize(args);
foreach (var child in node.Value.Nodes)
if (child.Key == "Children")
foreach (var c in child.Value.Nodes)
LoadWidget(args, widget, c);
var logicNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "Logic");
var logic = logicNode == null ? null : logicNode.Value.ToDictionary();
args.Add("logicArgs", logic);
widget.PostInit(args);
args.Remove("logicArgs");
return widget;
}