コード例 #1
0
 public void UpdateCurrentItemPlayTime()
 {
     //TODO: Don't use SelectedItem? What if selection is changed while process is still running?
     //Only log time if the session lasted more than 5 minutes
     if (CurrentProcess.RunTime != null && CurrentProcess.RunTime.TotalMinutes > 5)
     {
         //The above IF should prevent DateTime.Now actually being used so this is fine
         DateTime startTime = CurrentProcess.TimeStarted ?? DateTime.Now;
         DateTime endTime   = CurrentProcess.TimeLastPolled ?? DateTime.Now;
         SelectedItem.AddPlayTime(startTime, endTime);
         LibraryFiler.SaveLibraryData();
     }
 }
コード例 #2
0
        // CONSTRUCTORS

        public MainViewModel()
        {
            //TODO: Scan directory asynchronously
            LibraryFiler.ScanDirectory();

            List <LibraryCollection> FullCollectionList = LibraryFiler.AllCollections;

            CollectionList = new List <LibraryCollection>();
            //Hide empty collections
            foreach (LibraryCollection collection in FullCollectionList)
            {
                IEnumerable <LibraryItem> collectionItems = LibraryFiler.FullLibraryList.Where(x => x.MatchesCollection(collection) && x.IsVisible);
                if (collection.IsVisible && collectionItems.Count() > 0)
                {
                    CollectionList.Add(collection);
                }
            }
        }
コード例 #3
0
 public void SaveGameRunSettings()
 {
     //Save settings to file
     LibraryFiler.SetRunSettings(ConsolesList);
 }
コード例 #4
0
 public void UpdateLibraryFile()
 {
     SelectedItem.Tags = GetInputTags();
     LibraryFiler.SaveLibraryData();
 }