public ItemFilterScriptTranslator(IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder, IItemFilterBlockTranslator blockTranslator, IItemFilterScriptFactory itemFilterScriptFactory) { _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; _blockTranslator = blockTranslator; _itemFilterScriptFactory = itemFilterScriptFactory; }
private ItemFilterScriptTranslator CreateItemFilterScriptTranslator(IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder = null, IItemFilterBlockTranslator itemFilterBlockTranslator = null, IItemFilterScriptFactory itemFilterScriptFactory = null) { var mockItemFilterScriptFactory = new Mock <IItemFilterScriptFactory>(); mockItemFilterScriptFactory .Setup(i => i.Create()) .Returns(new ItemFilterScript()); return(new ItemFilterScriptTranslator(blockGroupHierarchyBuilder ?? new Mock <IBlockGroupHierarchyBuilder>().Object, itemFilterBlockTranslator ?? new Mock <IItemFilterBlockTranslator>().Object, itemFilterScriptFactory ?? mockItemFilterScriptFactory.Object)); }
public ItemFilterScriptViewModel(IItemFilterBlockBaseViewModelFactory itemFilterBlockBaseViewModelFactory, IItemFilterBlockTranslator blockTranslator, IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel, IItemFilterPersistenceService persistenceService, IMessageBoxService messageBoxService, IClipboardService clipboardService, IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder) { _itemFilterBlockBaseViewModelFactory = itemFilterBlockBaseViewModelFactory; _blockTranslator = blockTranslator; _avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel; _avalonDockWorkspaceViewModel.ActiveDocumentChanged += OnActiveDocumentChanged; _persistenceService = persistenceService; _messageBoxService = messageBoxService; _clipboardService = clipboardService; _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; _itemFilterBlockViewModels = new ObservableCollection <IItemFilterBlockViewModelBase>(); _avalonDockWorkspaceViewModel.ActiveDocumentChanged += (s, e) => { RaisePropertyChanged(nameof(IsActiveDocument)); }; ToggleShowAdvancedCommand = new RelayCommand <bool>(OnToggleShowAdvancedCommand); ClearFilterCommand = new RelayCommand(OnClearFilterCommand, () => BlockFilterPredicate != null); CloseCommand = new RelayCommand(async() => await OnCloseCommand()); DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null); MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null && ItemFilterBlockViewModels.IndexOf(SelectedBlockViewModel) > 0); MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null && ItemFilterBlockViewModels.IndexOf(SelectedBlockViewModel) > 0); MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand, () => SelectedBlockViewModel != null && ItemFilterBlockViewModels.IndexOf(SelectedBlockViewModel) < ItemFilterBlockViewModels.Count); MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModel != null && ItemFilterBlockViewModels.IndexOf(SelectedBlockViewModel) < ItemFilterBlockViewModels.Count); AddBlockCommand = new RelayCommand(OnAddBlockCommand); AddSectionCommand = new RelayCommand(OnAddCommentBlockCommand, () => SelectedBlockViewModel != null); DisableBlockCommand = new RelayCommand(OnDisableBlockCommand, HasSelectedEnabledBlock); EnableBlockCommand = new RelayCommand(OnEnableBlockCommand, HasSelectedDisabledBlock); CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => SelectedBlockViewModel != null); CopyBlockStyleCommand = new RelayCommand(OnCopyBlockStyleCommand, () => SelectedBlockViewModel != null); PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null); PasteBlockStyleCommand = new RelayCommand(OnPasteBlockStyleCommand, () => SelectedBlockViewModel != null); ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand); CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand); var icon = new BitmapImage(); icon.BeginInit(); icon.UriSource = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/script_icon.png"); icon.EndInit(); IconSource = icon; }
public ItemFilterBlockTranslator(IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder) { _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; }
public ItemFilterScriptViewModel(IItemFilterBlockViewModelFactory itemFilterBlockViewModelFactory, IItemFilterBlockTranslator blockTranslator, IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel, IItemFilterPersistenceService persistenceService, IMessageBoxService messageBoxService, IClipboardService clipboardService, IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder) { _itemFilterBlockViewModelFactory = itemFilterBlockViewModelFactory; _blockTranslator = blockTranslator; _avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel; _avalonDockWorkspaceViewModel.ActiveDocumentChanged += OnActiveDocumentChanged; _persistenceService = persistenceService; _messageBoxService = messageBoxService; _clipboardService = clipboardService; _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; _itemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModel>(); ToggleShowAdvancedCommand = new RelayCommand<bool>(OnToggleShowAdvancedCommand); ClearFilterCommand = new RelayCommand(OnClearFilterCommand, () => BlockFilterPredicate != null); CloseCommand = new RelayCommand(async () => await OnCloseCommand()); DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null); MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null); MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null); MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand, () => SelectedBlockViewModel != null); MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModel != null); AddBlockCommand = new RelayCommand(OnAddBlockCommand); AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => SelectedBlockViewModel != null); DisableBlockCommand = new RelayCommand(OnDisableBlockCommand, HasSelectedEnabledBlock); EnableBlockCommand = new RelayCommand(OnEnableBlockCommand, HasSelectedDisabledBlock); CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => SelectedBlockViewModel != null); CopyBlockStyleCommand = new RelayCommand(OnCopyBlockStyleCommand, () => SelectedBlockViewModel != null); PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null); PasteBlockStyleCommand = new RelayCommand(OnPasteBlockStyleCommand, () => SelectedBlockViewModel != null); ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand); CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand); var icon = new BitmapImage(); icon.BeginInit(); icon.UriSource = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/script_icon.png"); icon.EndInit(); IconSource = icon; }
public ItemFilterScriptTranslator(IItemFilterBlockTranslator blockTranslator, IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder) { _blockTranslator = blockTranslator; _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; }
public ItemFilterScriptTranslator(IItemFilterBlockTranslator blockTranslator, IBlockGroupHierarchyBuilder blockGroupHierarchyBuilder) { _blockTranslator = blockTranslator; _blockGroupHierarchyBuilder = blockGroupHierarchyBuilder; }