本文整理汇总了C#中ActionBar.AddToggle方法的典型用法代码示例。如果您正苦于以下问题:C# ActionBar.AddToggle方法的具体用法?C# ActionBar.AddToggle怎么用?C# ActionBar.AddToggle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionBar
的用法示例。
在下文中一共展示了ActionBar.AddToggle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToggles
/// <summary>
/// Adds the option toggles to the given ActionBar.
/// </summary>
public static void AddToggles(ActionBar bar)
{
foreach (IRoleFillerRule rule in AllRules)
{
IRoleFillerRule local = rule;
bar.AddToggle(local.Name, (bool b) => MarkActive(local, b), ActiveRules.Contains(local));
}
}
示例2: Init
private void Init()
{
importSelection = new ActionBar(false, true, false);
//Add all available narratives to the selection of available files.
foreach (string name in serializer.OfferNames())
{
string localName = name;
importSelection.AddToggle(name, (bool val) =>
{
if (val)
{
importFileName = exportFileName = localName;
}
else
{
importFileName = null;
}
});
}
path = serializer.DirectoryPath;
}
示例3: EventSchedulerWindow
/// <summary>
/// Creates a new EventSchedulerWindow.
/// </summary>
public EventSchedulerWindow()
{
IEnumerable<EventSignature> allSignatures = EventLibrary.Instance.GetSignatures();
allSignatures = allSignatures.Where((EventSignature sig) => !sig.AffectsWorldState());
foreach (EventSignature sig in allSignatures)
{
allEvents.Add(new SchedulerEventArguments(sig, 0.0f, false));
}
existingCollectionSelector = new ActionBar(true, true, false);
foreach(EventCollection collection in EventCollectionManager.Instance.AllCollections)
{
EventCollection localCollection = collection;
existingCollectionSelector.AddToggle(collection.Name,
(bool b) =>
{
if (b) Set(localCollection);
});
}
}
示例4: SelectCrowdBar
/// <summary>
/// The default bar for selecting a new crowd.
/// </summary>
private ActionBar SelectCrowdBar()
{
ActionBar result = new ActionBar(true);
result.AddToggle("Crowd Static", (bool b) => crowdStatic = b);
result.AddButton("Cancel", Reset);
return result;
}