本文整理汇总了C#中Hearthstone_Deck_Tracker.Hearthstone.Deck.Edited方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.Edited方法的具体用法?C# Deck.Edited怎么用?C# Deck.Edited使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hearthstone_Deck_Tracker.Hearthstone.Deck
的用法示例。
在下文中一共展示了Deck.Edited方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ArchiveDeck
public void ArchiveDeck(Deck deck, bool archive, bool saveAndUpdate = true)
{
if(deck == null)
return;
var oldArchived = deck.Archived;
if(oldArchived == archive)
return;
deck.Archived = archive;
deck.Edited();
try
{
if(saveAndUpdate)
{
DeckList.Save();
DeckPickerList.UpdateDecks();
if(archive)
SelectDeck(null, true);
else
{
DeckPickerList.SelectDeckAndAppropriateView(deck);
UpdateMenuItemVisibility();
}
DeckPickerList.UpdateArchivedClassVisibility();
}
var archivedLog = archive ? "archived" : "unarchived";
Logger.WriteLine(String.Format("Successfully {0} deck: {1}", archivedLog, deck.Name), "ArchiveDeck");
if(Config.Instance.HearthStatsAutoUploadNewDecks && HearthStatsAPI.IsLoggedIn)
{
Logger.WriteLine(String.Format("auto uploading {0} deck", archivedLog), "ArchiveDeck");
HearthStatsManager.UpdateDeckAsync(deck, background: true);
}
}
catch(Exception)
{
Logger.WriteLine(String.Format("Error {0} deck", archive ? "archiving" : "unarchiving", deck.Name), "ArchiveDeck");
}
}