protected override void Execute()
        {
            IStudioEventAggregator ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var notificationGroup = new StudioTestNotificationsGroup(NOTIFICATION_GROUP_ID)
            {
                Title = "First Group title"
            };

            notificationGroup.Notifications.Add(new StudioTestNotification(new Guid())
            {
                Title = "First notification title",
                AlwaysVisibleDetails = new List <string> {
                    "First notification description"
                }
            });
            notificationGroup.Notifications.Add(new StudioTestNotification(new Guid())
            {
                Title = "Second notification title",
                AlwaysVisibleDetails = new List <string> {
                    "Third notification  description", "Forth notification description"
                }
            });

            // add group notification
            var addTestGroup = new AddStudioGroupNotificationEvent(notificationGroup);

            ea.Publish(addTestGroup);

            // remove group notification
            var removeTestGroup = new RemoveStudioGroupNotificationEvent(NOTIFICATION_GROUP_ID);

            ea.Publish(removeTestGroup);
        }
        protected override void Execute()
        {
            IStudioEventAggregator ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var showNotification = new ShowStudioNotificationsViewEvent(true, true);

            ea.Publish(showNotification);
        }
Esempio n. 3
0
 public void Execute()
 {
     _eventAggregator = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();
     _eventAggregator.GetEvent <StudioWindowCreatedNotificationEvent>().Subscribe(OnStudioWindowCreated);
     _notificationGroup = new SampleNotificationGroup(NotificationGroupId)
     {
         Title = "Sample notifications"
     };
 }
Esempio n. 4
0
        public InSourceViewController()
        {
            _projectRequests = new List <ProjectRequest>();
            _hasTemplateList = new List <bool>();
            _hasFiles        = new List <bool>();
            _eventAggregator = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            _notificationGroup = new InSourceNotificationGroup(NotificationGroupId)
            {
                Title = "InSource Notifications"
            };
        }
Esempio n. 5
0
        public RateItViewModel(IShortcutService shortcutService, IActionProvider actionProvider, ISegmentSupervisor segmentSupervisor, IMessageBoxService messageBoxService, EditorController editorController, IStudioEventAggregator eventAggregator)
        {
            _actionProvider    = actionProvider;
            _segmentSupervisor = segmentSupervisor;
            _messageBoxService = messageBoxService;
            _editorController  = editorController;
            _eventAggregator   = eventAggregator;
            _shortcutService   = shortcutService;

            Initialize();
            UpdateActionTooltips();
        }
Esempio n. 6
0
        protected override void Execute()
        {
            IStudioEventAggregator ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var notificationGroup = new StudioTestNotificationsGroup(NOTIFICATION_GROUP_ID)
            {
                Title = "First Group title"
            };

            notificationGroup.Notifications.Add(new StudioTestNotification(new Guid())
            {
                Title = "First notification title",
                AlwaysVisibleDetails = new List <string> {
                    "First notification description"
                }
            });
            notificationGroup.Notifications.Add(new StudioTestNotification(new Guid())
            {
                Title = "Second notification title",
                AlwaysVisibleDetails = new List <string> {
                    "Third notification  description", "Forth notification description"
                }
            });

            // add group notification
            var addTestGroup = new AddStudioGroupNotificationEvent(notificationGroup);

            ea.Publish(addTestGroup);

            // Add 1 Notification to group
            var notification1 = new StudioTestNotification(new Guid())
            {
                Title = "Dog title",
                AlwaysVisibleDetails = new List <string> {
                    "AAA", "BBB", "CCC"
                }
            };
            var addTestNotification = new AddStudioNotificationToGroupEvent(NOTIFICATION_GROUP_ID, notification1);

            ea.Publish(addTestNotification);

            // show notifications and set focus
            var showNotification = new ShowStudioNotificationsViewEvent(showNotifications: true, setFocus: true);

            ea.Publish(showNotification);
        }
        protected override void Initialize(IViewContext context)
        {
            _pathInfo     = new PathInfo();
            _imageService = new ImageService(_pathInfo);
            _imageService.ExtractFlags();


            ActivationChanged += OnActivationChanged;


            _eventAggregator = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();
            _eventAggregator.GetEvent <StudioWindowCreatedNotificationEvent>()?.Subscribe(OnStudioWindowCreatedNotificationEvent);

            _projectsController = SdlTradosStudio.Application.GetController <ProjectsController>();
            //var project = _projectsController.CurrentProject.GetProjectInfo();

            // TODO this will be replaced with a call to recover the relevant data from the projects loaded in Studio
            var testDataUtil = new TestDataUtil(_imageService);

            _projectModels = testDataUtil.GetTestProjectData();
        }
Esempio n. 8
0
        protected override void Execute()
        {
            IStudioEventAggregator ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var notification1 = new StudioTestNotification(new Guid())
            {
                Title = "Dog title", AlwaysVisibleDetails = new List <string> {
                    "AAA", "BBB", "CCC"
                }
            };
            var addTestGroup1 = new AddStudioNotificationToGroupEvent(NOTIFICATION_GROUP_ID, notification1);

            ea.Publish(addTestGroup1);

            var notification2 = new StudioTestNotification(new Guid())
            {
                Title = "Cat title", AlwaysVisibleDetails = new List <string> {
                    "111"
                }
            };
            var addTestGroup2 = new AddStudioNotificationToGroupEvent(NOTIFICATION_GROUP_ID, notification2);

            ea.Publish(addTestGroup2);
        }
Esempio n. 9
0
 public EventAggregatorService(IStudioEventAggregator studioEventAggregator)
 {
     _studioEventAggregator = studioEventAggregator;
 }
Esempio n. 10
0
 public void Execute()
 {
     _eventAggregator = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();
     _eventAggregator.GetEvent <StudioWindowCreatedNotificationEvent>().Subscribe(OnStudioWindowCreated);
 }
 public PackagesControl()
 {
     InitializeComponent();
     _app             = new StudioApplication();
     _eventAggregator = _app.GetService <IStudioEventAggregator>();
 }
 public MyCustomAction()
 {
     _app             = new StudioApplication();
     _eventAggregator = _app.GetService <IStudioEventAggregator>();
 }