Ejemplo n.º 1
0
        /// <summary>
        /// Opens analysis of a single library item game
        /// </summary>
        /// <param name="game">Game to analyze</param>
        private async Task AnalyzeLibraryItemGameAsync(LibraryItemGame game)
        {
            var libraryItem = LibraryItems.FirstOrDefault(i => i.Games.Contains(game));

            if (libraryItem != null)
            {
                //app data library item
                var appDataLibraryItem = libraryItem as AppDataLibraryItemViewModel;
                if (appDataLibraryItem != null)
                {
                    await AnalyzeGameAsync(appDataLibraryItem, game);
                }
            }
            else
            {
                //selected item, external
                if (SelectedLibraryItem?.Games.Contains(game) == true)
                {
                    var externalLibraryItem = SelectedLibraryItem as ExternalSgfFileViewModel;
                    if (externalLibraryItem != null)
                    {
                        AnalyzeGame(externalLibraryItem, game);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public LibraryItem GetItem(int id) => LibraryItems.FirstOrDefault(x => x.Id == id);