public void SetUp() { _settings = new DataSource { Id = Guid.NewGuid() }; _merged = new MergedDataSource(_scheduler, _settings); }
public void TestAddGroup1() { var settings = new DataSourceSettings(); using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { MergedDataSource group = dataSources.AddGroup(); group.Should().NotBeNull(); group.Settings.Should().NotBeNull(); settings.Should().Equal(group.Settings); } }
public void TestAddGroup1() { var settings = new Tailviewer.Settings.DataSources(); using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logFileFactory, _scheduler, settings)) { MergedDataSource group = dataSources.AddGroup(); group.Should().NotBeNull(); group.Settings.Should().NotBeNull(); settings.Should().Equal(group.Settings); } }
public void SetUp() { _taskScheduler = new ManualTaskScheduler(); _logFileFactory = new PluginLogFileFactory(_taskScheduler); _settings = new DataSource { Id = DataSourceId.CreateNew(), MergedDataSourceDisplayMode = DataSourceDisplayMode.CharacterCode }; _merged = new MergedDataSource(_taskScheduler, _settings, TimeSpan.Zero) { IsSingleLine = true }; }
public MergedDataSourceViewModel(MergedDataSource dataSource, IActionCenter actionCenter) : base(dataSource) { if (actionCenter == null) { throw new ArgumentNullException(nameof(actionCenter)); } _actionCenter = actionCenter; _dataSource = dataSource; _observable = new ObservableCollection <IDataSourceViewModel>(); _openInExplorerCommand = new DelegateCommand(OpenInExplorer); Update(); }
private void Drag(IDataSourceViewModel source, IDataSourceViewModel dest) { var merged = dest as MergedDataSourceViewModel; if (merged != null) { // Drag from ungrouped onto an existing group // => add to existing group AddFileToGroup(source, merged); SelectedItem = merged; } else { // Drag from ungrouped onto a dest within a group // => find group of dest and addd to it merged = dest.Parent as MergedDataSourceViewModel; if (merged != null) { AddFileToGroup(source, merged); SelectedItem = merged; } else { // Drag from ungrouped onto another ungrouped source // => remove dest as well and create new group int destIndex = _observable.IndexOf(dest); if (destIndex != -1) { _observable.Remove(dest); MergedDataSource mergedDataSource = _dataSources.AddGroup(); merged = new MergedDataSourceViewModel(mergedDataSource, _actionCenter, _settings); merged.Remove += OnRemove; merged.AddChild(source); merged.AddChild(dest); _observable.Insert(destIndex, merged); _allDataSourceViewModels.Add(merged); SelectedItem = merged; } } } }
public void TestAddGroup2() { MergedDataSource group = _dataSources.AddGroup(); group.Id.Should().NotBe(Guid.Empty); }
public MergedDataSourceViewModel(MergedDataSource dataSource) : base(dataSource) { _dataSource = dataSource; _observable = new ObservableCollection<IDataSourceViewModel>(); }
private MergedDataSourceViewModel CreateMergedViewModel(MergedDataSource dataSource) { return(new MergedDataSourceViewModel(dataSource, _actionCenter.Object, _applicationSettings.Object)); }