Esempio n. 1
0
        private void left_MediaEnded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (model.EnableAutoPlaylist)
                {
                    TeslaCamFileSet         target = this.model.CurrentPlaybackFile;
                    TeslaCamEventCollection f      = model.ListItems.SelectMany(d => d.Events).Where(d => d.Recordings.Contains(target)).First();
                    if (f != null)
                    {
                        int currentFileIndex = f.Recordings.IndexOf(target);
                        if (f.Recordings.Count - 1 > currentFileIndex)
                        {
                            TeslaCamFileSet nextSet = f.Recordings[currentFileIndex + 1];

                            paused = false;
                            model.LoadFileSet(nextSet);
                            var tvi = FindTviFromObjectRecursive(treeview, nextSet);

                            if (tvi != null)
                            {
                                tvi.IsSelected = true;
                            }
                        }
                    }
                }
            }
            catch { }
        }
        public void BuildFromBaseDirectory(string directory)
        {
            var directories = System.IO.Directory.GetDirectories(directory);

            foreach (var dir in directories)
            {
                var teslaCamEventCollection = new TeslaCamEventCollection();

                if (teslaCamEventCollection.BuildFromDirectory(dir))
                {
                    Events.Add(teslaCamEventCollection);
                }
            }

            var baseFiles = System.IO.Directory.GetFiles(directory);

            if (baseFiles.Any())
            {
                var baseCollection = new TeslaCamEventCollection();
                baseCollection.BuildFromDirectory(directory);
                Events.Add(baseCollection);
            }

            Events      = new ObservableCollection <TeslaCamEventCollection>(Events.OrderBy(e => e.StartDate.UTCDateString));
            DisplayName = new System.IO.DirectoryInfo(directory).Name;
        }
 public void BuildFromBaseDirectory(string Directory)
 {
     string[] Directories = System.IO.Directory.GetDirectories(Directory);
     foreach (var Dir in Directories)
     {
         try
         {
             var e = new TeslaCamEventCollection();
             e.BuildFromDirectory(Dir);
             this.Events.Add(e);
         }
         catch
         {
         }
     }
     string[] BaseFiles = System.IO.Directory.GetFiles(Directory);
     if (BaseFiles.Count() > 0)
     {
         var baseCollection = new TeslaCamEventCollection();
         baseCollection.BuildFromDirectory(Directory);
         this.Events.Add(baseCollection);
     }
     this.Events      = new ObservableCollection <TeslaCamEventCollection>(Events.OrderBy(e => e.StartDate.UTCDateString));
     this.DisplayName = new System.IO.DirectoryInfo(Directory).Name;
 }