本文整理匯總了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;
}