Example #1
0
        public DescriptionsView(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            IUnityContainer container,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(DescriptionsViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsViewModel viewModel)
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;
            m_Container       = container;
            m_ShellView       = shellView;
            m_Session         = session;

            m_ViewModel           = viewModel;
            m_ViewModel.ShellView = m_ShellView;

            m_Logger.Log("DescriptionsView.ctor", Category.Debug, Priority.Medium);

            DataContext = m_ViewModel;
            InitializeComponent();
        }
Example #2
0
        public NavigationPanePlugin(
            ILoggerFacade logger,
            IRegionManager regionManager,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(NavigationPane), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            NavigationPane pane)
        {
            m_Logger        = logger;
            m_RegionManager = regionManager;

            m_UrakawaSession = session;
            m_ShellView      = shellView;
            m_NavPane        = pane;

            m_RegionManager.RegisterNamedViewWithRegion(RegionNames.NavigationPane,
                                                        new PreferredPositionNamedView {
                m_viewInstance = m_NavPane, m_viewName = @"ViewOf_" + RegionNames.NavigationPane
            });

            //m_RegionManager.RegisterViewWithRegion(RegionNames.NavigationPane, typeof(NavigationPane));

            //IRegion targetRegion = m_RegionManager.Regions[RegionNames.NavigationPane];
            //targetRegion.Add(m_NavPane);
            //targetRegion.Activate(m_NavPane);

            //m_Logger.Log(@"Navigation pane plugin initializing...", Category.Debug, Priority.Medium);
        }
Example #3
0
        public DescriptionsNavigationView(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(DescriptionsNavigationViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsNavigationViewModel viewModel,
            [Import(typeof(IDescriptionsView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsView view
            )
        {
            m_UrakawaSession  = urakawaSession;
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_ShellView = shellView;
            ViewModel   = viewModel;
            DataContext = ViewModel;

            m_DescriptionsView = view;

            InitializeComponent();
            ViewModel.SetView(this);
        }
        public DescriptionsPlugin(
            ILoggerFacade logger,
            IUnityContainer container,
            IEventAggregator eventAggregator,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IDescriptionsView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsView view
            )
        {
            m_Logger           = logger;
            m_Container        = container;
            m_ShellView        = shellView;
            m_DescriptionsView = view;

            m_UrakawaSession  = session;
            m_EventAggregator = eventAggregator;

            CommandShowDescriptions = new RichDelegateCommand(
                Tobi_Plugin_Descriptions_Lang.CmdEditDescriptions_ShortDesc,
                Tobi_Plugin_Descriptions_Lang.CmdEditDescriptions_LongDesc,
                null, // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadTangoIcon(@"edit-find-replace"),
                ShowDialog,
                CanShowDialog,
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_EditDescriptions));

            m_ShellView.RegisterRichCommand(CommandShowDescriptions);

            //m_Logger.Log(@"DescriptionsPlugin init", Category.Debug, Priority.Medium);
        }
Example #5
0
        public DocumentPanePlugin(
            ILoggerFacade logger,
            IRegionManager regionManager,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(DocumentPaneView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DocumentPaneView docView)
        {
            m_Logger        = logger;
            m_RegionManager = regionManager;

            m_UrakawaSession = session;
            m_ShellView      = shellView;
            m_DocView        = docView;

            m_RegionManager.RegisterNamedViewWithRegion(RegionNames.DocumentPane,
                                                        new PreferredPositionNamedView {
                m_viewInstance = m_DocView, m_viewName = VIEW_NAME
            });

            //m_RegionManager.RegisterViewWithRegion(RegionNames.DocumentPane, typeof(DocumentPaneView));

            //IRegion targetRegion = m_RegionManager.Regions[RegionNames.DocumentPane];
            //targetRegion.Add(m_DocView);
            //targetRegion.Activate(m_DocView);

            //m_Logger.Log(@"Document pane plugin initializing...", Category.Debug, Priority.Medium);
        }
        public MetadataPaneViewModel(
            IEventAggregator eventAggregator,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(MetadataValidator), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false)]
            MetadataValidator validator
            )
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_Validator      = validator;
            m_UrakawaSession = session;
            m_ShellView      = shellView;

            m_MetadataCollection = null;

            ValidationItems = new ObservableCollection <ValidationItem>();

            if (m_Validator != null)
            {
                m_Validator.ValidatorStateRefreshed += OnValidatorStateRefreshed;
                resetValidationItems(m_Validator);
            }

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(OnProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(OnProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);
        }
Example #7
0
        public MetadataPanePlugin(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IMetadataPaneView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            MetadataPaneView view)
        {
            m_Logger           = logger;
            m_UrakawaSession   = session;
            m_ShellView        = shellView;
            m_MetadataPaneView = view;
            m_EventAggregator  = eventAggregator;

            CommandShowMetadataPane = new RichDelegateCommand(
                Tobi_Plugin_MetadataPane_Lang.CmdShowMetadata_ShortDesc,
                Tobi_Plugin_MetadataPane_Lang.CmdShowMetadata_LongDesc,
                null, // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadGnomeGionIcon(@"Gion_text-x-readme"),
                ShowDialog,
                CanShowDialog,
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Metadata_Edit));

            m_ShellView.RegisterRichCommand(CommandShowMetadataPane);

            m_EventAggregator.GetEvent <LaunchMetadataEditorEvent>().Subscribe(OnLaunchMetadataEditor, LaunchMetadataEditorEvent.THREAD_OPTION);


            //m_Logger.Log(@"Metadata plugin initializing...", Category.Debug, Priority.Medium);
        }
Example #8
0
        public SettingsView(
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(ISettingsAggregator), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false)]
            ISettingsAggregator settingsAggregator)
        {
            m_PropertyChangeHandler = new PropertyChangedNotifyBase();
            m_PropertyChangeHandler.InitializeDependentProperties(this);

            m_Logger    = logger;
            m_ShellView = shellView;
            m_Session   = session;

            m_SettingsAggregator = settingsAggregator;

            resetList();

            InitializeComponent();

            intializeCommands();

            // NEEDS to be after InitializeComponent() in order for the DataContext bridge to work.
            DataContext = this;
        }
Example #9
0
        public SettingsPlugin(
            ILoggerFacade logger,
            IUnityContainer container,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            //[Import(typeof(SettingsView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            //SettingsView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(ISettingsAggregator), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false)]
            ISettingsAggregator settingsAggregator)
        {
            m_Logger    = logger;
            m_Container = container;
            m_ShellView = shellView;

            //m_SettingsView = view;
            m_UrakawaSession = session;

            m_SettingsAggregator = settingsAggregator;

            CommandShowSettings = new RichDelegateCommand(
                Tobi_Plugin_Settings_Lang.Cmd_ApplicationPref,
                Tobi_Plugin_Settings_Lang.Cmd_DisplayEditor,
                null, // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadTangoIcon(@"preferences-system"),
                ShowDialog,
                CanShowDialog,
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_EditPreferences));

            m_ShellView.RegisterRichCommand(CommandShowSettings);

            //m_Logger.Log(@"SettingsPlugin init", Category.Debug, Priority.Medium);
        }
        public MissingAudioValidator(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false, AllowDefault = false)]
            IUrakawaSession session)
            : base(eventAggregator)
        {
            m_Logger  = logger;
            m_Session = session;

            m_EventAggregator.GetEvent <NoAudioContentFoundByFlowDocumentParserEvent>().Subscribe(OnNoAudioContentFoundByFlowDocumentParserEvent, NoAudioContentFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_Logger.Log(@"MissingAudioValidator initialized", Category.Debug, Priority.Medium);
        }
Example #11
0
        public ContentDocumentValidator(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false, AllowDefault = false)]
            IUrakawaSession session)
            : base(eventAggregator)
        {
            m_Logger  = logger;
            m_Session = session;

            m_DtdRegex = new DtdSharpToRegex();

            m_Logger.Log(@"ContentDocumentValidator initialized", Category.Debug, Priority.Medium);
        }
Example #12
0
        public MetadataValidator(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false, AllowDefault = false)]
            IUrakawaSession session)
            : base(eventAggregator)
        {
            m_Logger  = logger;
            m_Session = session;

            m_DataTypeValidator      = new MetadataDataTypeValidator(this, m_EventAggregator);
            m_OccurrenceValidator    = new MetadataOccurrenceValidator(this, m_EventAggregator);
            m_ValidationItemTemplate = new MetadataValidationItemTemplate();

            m_Logger.Log(@"MetadataValidator initialized", Category.Debug, Priority.Medium);
        }
        public MarkersPanelView(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession,
            [Import(typeof(MarkersPaneViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            MarkersPaneViewModel viewModel)
        {
            m_UrakawaSession  = urakawaSession;
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            ViewModel   = viewModel;
            DataContext = ViewModel;

            InitializeComponent();
            ViewModel.SetView(this);
        }
Example #14
0
        public ValidatorPlugin(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession,
            [Import(typeof(ValidatorPaneView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            ValidatorPaneView view)
        {
            m_Logger         = logger;
            m_ShellView      = shellView;
            m_UrakawaSession = urakawaSession;

            m_EventAggregator = eventAggregator;

            m_ValidatorPaneView = view;

            m_validatorClassToShow = null;

            m_EventAggregator.GetEvent <ValidationReportRequestEvent>().Subscribe(
                validatorClassName =>
            {
                m_validatorClassToShow = validatorClassName as String;
                CommandShowValidator.Execute();
            },
                ValidationReportRequestEvent.THREAD_OPTION);


            CommandShowValidator = new RichDelegateCommand(
                Tobi_Plugin_Validator_Lang.CmdValidationCheck_ShortDesc,
                Tobi_Plugin_Validator_Lang.CmdValidationCheck_LongDesc,
                null, // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadGnomeGionIcon(@"Gion_application-certificate"),
                ShowDialog,
                CanShowDialog,
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_DisplayValidator));

            m_ShellView.RegisterRichCommand(CommandShowValidator);

            //m_Logger.Log(@"ValidatorPlugin init", Category.Debug, Priority.Medium);
        }
Example #15
0
        public RecentFilesView(
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session)
        {
            m_PropertyChangeHandler = new PropertyChangedNotifyBase();
            m_PropertyChangeHandler.InitializeDependentProperties(this);

            m_Logger    = logger;
            m_ShellView = shellView;
            m_Session   = session;

            resetList();

            DataContext = this;
            InitializeComponent();

            intializeCommands();
        }
Example #16
0
        public DescriptionsViewModel(
            IEventAggregator eventAggregator,
            IUnityContainer container,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session
            )
        {
            m_EventAggregator = eventAggregator;
            m_Container       = container;
            m_Logger          = logger;

            m_UrakawaSession = session;

            ShowAdvancedEditor = false;

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(OnProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(OnProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
Example #17
0
        public ValidatorAggregator(
            ILoggerFacade logger,
            IEventAggregator eventAggregator,
            [ImportMany(typeof(IValidator), RequiredCreationPolicy = CreationPolicy.Shared, AllowRecomposition = false)]
            IEnumerable <IValidator> validators,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session)
        {
            m_EventAggregator = eventAggregator;
            m_UrakawaSession  = session;
            m_Logger          = logger;

            foreach (IValidator validator in validators)
            {
                m_Validators.Add(validator);
                validator.ValidatorStateRefreshed += OnValidatorStateRefreshed;
            }

            //m_EventAggregator.GetEvent<ProjectLoadedEvent>().Subscribe(OnProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            //m_EventAggregator.GetEvent<ProjectUnLoadedEvent>().Subscribe(OnProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);
        }
Example #18
0
        public MetadataPaneView(
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(MetadataPaneViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            MetadataPaneViewModel viewModel)
        {
            m_Logger         = logger;
            m_UrakawaSession = session;
            m_ShellView      = shellView;

            m_ViewModel = viewModel;

            m_Logger.Log("MetadataPaneView.ctor", Category.Debug, Priority.Medium);

            DataContext    = m_ViewModel;
            ErrorWithFocus = null;
            InitializeComponent();
        }
Example #19
0
        public DescriptionsNavigationPlugin(
            ILoggerFacade logger,
            IRegionManager regionManager,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView,
            [Import(typeof(DescriptionsNavigationView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsNavigationView pane,
            [Import(typeof(DescriptionsNavigationViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            DescriptionsNavigationViewModel viewModel
            )
        {
            m_Logger        = logger;
            m_RegionManager = regionManager;

            m_UrakawaSession           = session;
            m_ShellView                = shellView;
            m_DescriptionsNavView      = pane;
            m_DescriptionsNavViewModel = viewModel;

            // Remark: using direct access instead of delayed lookup (via the region registry)
            // generates an exception, because the region does not exist yet (see "parent" plugin constructor, RegionManager.SetRegionManager(), etc.)

            m_RegionManager.RegisterNamedViewWithRegion(RegionNames.NavigationPaneTabs,
                                                        new PreferredPositionNamedView
            {
                m_viewInstance          = m_DescriptionsNavView,
                m_viewName              = @"ViewOf_" + RegionNames.NavigationPaneTabs + @"_Descriptions",
                m_viewPreferredPosition = PreferredPosition.Last
            });

            //m_RegionManager.RegisterViewWithRegion(RegionNames.NavigationPaneTabs, typeof(IDescriptionsNavigationView));

            //IRegion targetRegion = m_RegionManager.Regions[RegionNames.NavigationPaneTabs];
            //targetRegion.Add(m_DescriptionsNavView);
            //targetRegion.Activate(m_DescriptionsNavView);

            //m_Logger.Log(@"Navigation pane plugin initializing...", Category.Debug, Priority.Medium);
        }
Example #20
0
        public HeadingPanelView(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession,
            [Import(typeof(HeadingPaneViewModel), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            HeadingPaneViewModel viewModel)
        {
            m_UrakawaSession  = urakawaSession;
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_ViewModel = viewModel;
            DataContext = m_ViewModel;

            m_ignoreTreeNodeSelectedEvent = false;
            //m_ignoreHeadingSelected = false;

            InitializeComponent();

            m_ViewModel.SetView(this);
        }
Example #21
0
        public HeadingPaneViewModel(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session)
        {
            //Container = container;
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_ShellView = view;
            m_session   = session;

            intializeCommands();

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
        public StructureTrailPaneView(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView shellView)
        {
            m_UrakawaSession  = urakawaSession;
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;
            m_ShellView       = shellView;

            DataContext = this;

            //
            CommandFocus = new RichDelegateCommand(
                Tobi_Plugin_StructureTrailPane_Lang.CmdDocumentFocus_ShortDesc,
                null,
                null, // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadGnomeNeuIcon("Neu_format-indent-more"),
                () => FocusHelper.FocusBeginInvoke(m_FocusStartElement),
                () => true,
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Focus_Doc));

            m_ShellView.RegisterRichCommand(CommandFocus);
            //

            InitializeComponent();

            var arrow = (Path)Application.Current.FindResource("Arrow");

            m_FocusStartElement = new TextBlockWithAutomationPeer
            {
                Text = " ",
                //Content = arrow,
                //BorderBrush = null,
                //BorderThickness = new Thickness(0.0),
                Background = Brushes.Transparent,
                //Foreground = Brushes.Black,
                Cursor     = Cursors.Cross,
                FontWeight = FontWeights.ExtraBold,
                //Style = m_ButtonStyle,
                Focusable = true,
                //IsTabStop = true
            };
            m_FocusStartElement2 = new TextBlockWithAutomationPeer
            {
                Text = " ",
                //Content = arrow,
                //BorderBrush = null,
                //BorderThickness = new Thickness(0.0),
                Background = Brushes.Transparent,
                //Foreground = Brushes.Black,
                Cursor     = Cursors.Cross,
                FontWeight = FontWeights.ExtraBold,
                //Style = m_ButtonStyle,
                Focusable = true,
                //IsTabStop = true
            };

            OnProjectUnLoaded(null);

            //m_EventAggregator.GetEvent<TreeNodeSelectedEvent>().Subscribe(OnTreeNodeSelected, TreeNodeSelectedEvent.THREAD_OPTION);
            //m_EventAggregator.GetEvent<SubTreeNodeSelectedEvent>().Subscribe(OnSubTreeNodeSelected, SubTreeNodeSelectedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(OnProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(OnProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            //m_EventAggregator.GetEvent<EscapeEvent>().Subscribe(obj => CommandFocus.Execute(), EscapeEvent.THREAD_OPTION);
        }
 public InvalidElementSequenceValidationError(IUrakawaSession session)
 {
     m_UrakawaSession = session;
     Severity         = ValidationSeverity.Error;
 }
 public UndefinedElementValidationError(IUrakawaSession session)
 {
     m_UrakawaSession = session;
     Severity         = ValidationSeverity.Error;
 }
        public DescriptionsNavigationViewModel(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession)
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;
            m_UrakawaSession  = urakawaSession;
            m_ShellView       = view;


            m_Logger.Log("DescriptionsNavigationViewModel.initializeCommands", Category.Debug, Priority.Medium);

            CommandFindFocusDescriptions = new RichDelegateCommand(
                @"DESCRIPTIONS CommandFindFocus DUMMY TXT",
                @"DESCRIPTIONS CommandFindFocus DUMMY TXT",
                null, // KeyGesture set only for the top-level CompositeCommand
                null,
                () =>
            {
                m_ShellView.RaiseEscapeEvent();

                if (View != null)
                {
                    IsSearchVisible = true;
                    FocusHelper.Focus(View.SearchBox);
                    View.SearchBox.SelectAll();
                }
            },
                () => View != null
                //&& View.SearchBox.Visibility == Visibility.Visible
                && View.SearchBox.IsEnabled,
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindNext)
                );

            CommandFindNextDescription = new RichDelegateCommand(
                @"DESCRIPTIONS CommandFindNext DUMMY TXT",
                @"DESCRIPTIONS CommandFindNext DUMMY TXT",
                null, // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                DescriptionsNavigator.FindNext(true);
            },
                () => DescriptionsNavigator != null && !string.IsNullOrEmpty(DescriptionsNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_DescriptionsFindNext)
                );

            CommandFindPrevDescription = new RichDelegateCommand(
                @"DESCRIPTIONS CommandFindPrevious DUMMY TXT",
                @"DESCRIPTIONS CommandFindPrevious DUMMY TXT",
                null, // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                DescriptionsNavigator.FindPrevious(true);
            },
                () => DescriptionsNavigator != null && !string.IsNullOrEmpty(DescriptionsNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_DescFindPrev)
                );

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <DescribableTreeNodeFoundByFlowDocumentParserEvent>().Subscribe(onDescribableTreeNodeFoundByFlowDocumentParser, DescribableTreeNodeFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
 public MissingAudioValidationError(IUrakawaSession session)
 {
     m_UrakawaSession = session;
     Severity         = ValidationSeverity.Warning;
 }
Example #27
0
        public MarkersPaneViewModel(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession urakawaSession)
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;
            m_UrakawaSession  = urakawaSession;
            m_ShellView       = view;


            m_Logger.Log("MarkersPaneViewModel.initializeCommands", Category.Debug, Priority.Medium);

            CommandToggleMark = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationToggleMark_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationToggleMark_LongDesc,
                null,                     // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                var cmd = SelectedTreeNode.Presentation.CommandFactory.CreateTreeNodeSetIsMarkedCommand(SelectedTreeNode, !SelectedTreeNode.IsMarked);
                SelectedTreeNode.Presentation.UndoRedoManager.Execute(cmd);
            },
                () => SelectedTreeNode != null && !m_UrakawaSession.isAudioRecording &&
                !m_UrakawaSession.IsXukSpine,         //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_ToggleDocMark));

            m_ShellView.RegisterRichCommand(CommandToggleMark);

            CommandRemoveAllMarks = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_LongDesc,
                null,                     // KeyGesture obtained from settings (see last parameters below)
                null,                     //m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                if (MarkersNavigator_MarkedTreeNodes.Count <= 0)
                {
                    return;
                }
                var treeNodes = new List <TreeNode>(MarkersNavigator_MarkedTreeNodes.Count);
                foreach (MarkedTreeNode marked in MarkersNavigator_MarkedTreeNodes)
                {
                    treeNodes.Add(marked.TreeNode);
                }

                m_UrakawaSession.DocumentProject.Presentations.Get(0).UndoRedoManager.StartTransaction(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_ShortDesc, Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_LongDesc, "MARKS_REMOVE_ALL");
                foreach (TreeNode treeNode in treeNodes)
                {
                    var cmd = treeNode.Presentation.CommandFactory.CreateTreeNodeSetIsMarkedCommand(treeNode, !treeNode.IsMarked);
                    treeNode.Presentation.UndoRedoManager.Execute(cmd);
                }
                m_UrakawaSession.DocumentProject.Presentations.Get(0).UndoRedoManager.EndTransaction();
            },
                () => m_UrakawaSession.DocumentProject != null && !m_UrakawaSession.isAudioRecording &&
                !m_UrakawaSession.IsXukSpine,         //SelectedTreeNode != null, //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_RemoveAllDocMarks));

            m_ShellView.RegisterRichCommand(CommandRemoveAllMarks);

            CommandFindFocusMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindFocus DUMMY TXT",
                @"MARKERS CommandFindFocus DUMMY TXT",
                null, // KeyGesture set only for the top-level CompositeCommand
                null,
                () =>
            {
                m_ShellView.RaiseEscapeEvent();

                if (View != null)
                {
                    IsSearchVisible = true;
                    FocusHelper.Focus(View.SearchBox);
                    View.SearchBox.SelectAll();
                }
            },
                () => View != null
                //&& View.SearchBox.Visibility == Visibility.Visible
                && View.SearchBox.IsEnabled,
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindNext)
                );

            CommandFindNextMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindNext DUMMY TXT", //UserInterfaceStrings.MarkersFindNext,
                @"MARKERS CommandFindNext DUMMY TXT", //UserInterfaceStrings.MarkersFindNext_,
                null,                                 // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                MarkersNavigator.FindNext(true);
            },
                () => MarkersNavigator != null && !string.IsNullOrEmpty(MarkersNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_MarkersFindNext)
                );

            CommandFindPrevMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.MarkersFindPrev,
                @"MARKERS CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.MarkersFindPrev_,
                null,                                     // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                MarkersNavigator.FindPrevious(true);
            },
                () => MarkersNavigator != null && !string.IsNullOrEmpty(MarkersNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_MarkersFindPrev)
                );

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <MarkedTreeNodeFoundByFlowDocumentParserEvent>().Subscribe(onMarkedTreeNodeFoundByFlowDocumentParser, MarkedTreeNodeFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
        public PagesPaneViewModel(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session)
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_ShellView = view;
            m_session   = session;

            m_Logger.Log("PagesPaneViewModel.initializeCommands", Category.Debug, Priority.Medium);

            CommandRenumberPages = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_LongDesc,
                null, // KeyGesture obtained from settings (see last parameters below)
                null, //m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                if (PagesNavigator_Pages.Count <= 0)
                {
                    return;
                }

                var textBox_pageNumberStringPrefix = new TextBox()
                {
                    Text = ""
                };

                var label_pageNumberStringPrefix = new TextBlock()
                {
                    Text   = Tobi_Plugin_NavigationPane_Lang.PageNumberPrefix + ": ",
                    Margin = new Thickness(8, 0, 8, 0),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Focusable           = true,
                    TextWrapping        = TextWrapping.Wrap
                };

                var panel_pageNumberStringPrefix = new DockPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Margin = new Thickness(0, 0, 0, 18)
                };
                label_pageNumberStringPrefix.SetValue(DockPanel.DockProperty, Dock.Left);
                panel_pageNumberStringPrefix.Children.Add(label_pageNumberStringPrefix);
                panel_pageNumberStringPrefix.Children.Add(textBox_pageNumberStringPrefix);

                var textBox_pageNumberIntegerStart = new TextBox()
                {
                    Text = "1"
                };

                var label_pageNumberIntegerStart = new TextBlock()
                {
                    Text   = Tobi_Plugin_NavigationPane_Lang.PageNumberStart + ": ",
                    Margin = new Thickness(8, 0, 8, 0),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Focusable           = true,
                    TextWrapping        = TextWrapping.Wrap
                };

                var panel_pageNumberIntegerStart = new DockPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Margin = new Thickness(0, 0, 0, 0)
                };
                label_pageNumberIntegerStart.SetValue(DockPanel.DockProperty, Dock.Left);
                panel_pageNumberIntegerStart.Children.Add(label_pageNumberIntegerStart);
                panel_pageNumberIntegerStart.Children.Add(textBox_pageNumberIntegerStart);



                var panel = new StackPanel
                {
                    Orientation         = Orientation.Vertical,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                };

                panel.Children.Add(panel_pageNumberStringPrefix);
                panel.Children.Add(panel_pageNumberIntegerStart);

                var windowPopup = new PopupModalWindow(m_ShellView,
                                                       UserInterfaceStrings.EscapeMnemonic(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc),
                                                       panel,
                                                       PopupModalWindow.DialogButtonsSet.OkCancel,
                                                       PopupModalWindow.DialogButton.Ok,
                                                       false, 250, 160, null, 40, null);
                windowPopup.ShowModal();

                if (windowPopup.ClickedDialogButton != PopupModalWindow.DialogButton.Ok)
                {
                    return;
                }


                string prefix = "";
                if (!String.IsNullOrEmpty(textBox_pageNumberStringPrefix.Text))
                {
                    prefix = textBox_pageNumberStringPrefix.Text;
                }

                int pageNumber = 1;
                if (!String.IsNullOrEmpty(textBox_pageNumberIntegerStart.Text))
                {
                    try
                    {
                        pageNumber = Int32.Parse(textBox_pageNumberIntegerStart.Text);
                    }
                    catch (Exception ex)
                    {
                        return;
                    }
                }



                var treeNodes = new List <TreeNode>(PagesNavigator_Pages.Count);
                foreach (Page marked in PagesNavigator_Pages)
                {
                    treeNodes.Add(marked.TreeNode);
                }

                string pageNumberStr = "";

                m_session.DocumentProject.Presentations.Get(0).UndoRedoManager.StartTransaction(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc, Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_LongDesc, "PAGE_BREAKS_RENUMBER");
                foreach (TreeNode treeNode in treeNodes)
                {
                    pageNumberStr = prefix + (pageNumber++);
                    var cmd       = treeNode.Presentation.CommandFactory.CreateTreeNodeChangeTextCommand(treeNode, pageNumberStr);
                    treeNode.Presentation.UndoRedoManager.Execute(cmd);
                }
                m_session.DocumentProject.Presentations.Get(0).UndoRedoManager.EndTransaction();
            },
                () => m_session.DocumentProject != null && !m_session.isAudioRecording &&
                !m_session.IsXukSpine, //SelectedTreeNode != null, //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                null)                  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_RemoveAllDocMarks)
            ;

            m_ShellView.RegisterRichCommand(CommandRenumberPages);

            CommandFindFocusPage = new RichDelegateCommand(
                @"PAGES CommandFindFocus DUMMY TXT",
                @"PAGES CommandFindFocus DUMMY TXT",
                null, // KeyGesture set only for the top-level CompositeCommand
                null,
                () =>
            {
                m_ShellView.RaiseEscapeEvent();

                if (View != null)
                {
                    IsSearchVisible = true;
                    FocusHelper.Focus(View.SearchBox);
                    View.SearchBox.SelectAll();
                }
            },
                () => View != null
                //&& View.SearchBox.Visibility == Visibility.Visible
                && View.SearchBox.IsEnabled,
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindNext)
                );

            CommandFindNextPage = new RichDelegateCommand(
                @"PAGES CommandFindNext DUMMY TXT", //UserInterfaceStrings.PageFindNext,
                @"PAGES CommandFindNext DUMMY TXT", //UserInterfaceStrings.PageFindNext_,
                null,                               // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                PagesNavigator.FindNext(true);
            },
                () => PagesNavigator != null && !string.IsNullOrEmpty(PagesNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_PageFindNext)
                );

            CommandFindPrevPage = new RichDelegateCommand(
                @"PAGES CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.PageFindPrev,
                @"PAGES CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.PageFindPrev_,
                null,                                   // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                PagesNavigator.FindPrevious(true);
            },
                () => PagesNavigator != null && !string.IsNullOrEmpty(PagesNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_PageFindPrev)
                );

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <PageFoundByFlowDocumentParserEvent>().Subscribe(onPageFoundByFlowDocumentParser, PageFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }