Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PartitionViewModel"/> class.
 /// </summary>
 /// <param name="sessionViewModel">The view model of the session to which this partition belongs.</param>
 /// <param name="partition">The partition for which to create the view model.</param>
 public PartitionViewModel(SessionViewModel sessionViewModel, IPartition partition)
 {
     this.partition        = partition;
     this.sessionViewModel = sessionViewModel;
     this.StreamTreeRoot   = new StreamTreeNode(this);
     foreach (var stream in this.partition.AvailableStreams)
     {
         this.StreamTreeRoot.AddPath(stream);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DatasetViewModel"/> class.
        /// </summary>
        /// <param name="dataset">The dataset for which to create the view model.</param>
        public DatasetViewModel(Dataset dataset)
        {
            this.dataset = dataset;
            this.internalSessionViewModels = new ObservableCollection <SessionViewModel>();
            this.sessionViewModels         = new ReadOnlyObservableCollection <SessionViewModel>(this.internalSessionViewModels);
            foreach (var item in this.dataset.Sessions)
            {
                this.internalSessionViewModels.Add(new SessionViewModel(this, item));
            }

            this.currentSessionViewModel = this.internalSessionViewModels.FirstOrDefault();
        }