private void openPackage(object sender, EventArgs e)
        {
            try
            {
                if (System.IO.File.Exists(textBoxPackagePath.Text))
                {
                    var publishJob = new SampleJob()
                    {
                        JobName = "Sample"
                    };
                    if (System.IO.File.Exists(textBoxIconPath.Text) && !string.IsNullOrWhiteSpace(textBoxProjectType.Text))
                    {
                        _eventAggregator.Publish(new OpenProjectPackageEvent(textBoxPackagePath.Text, publishJob, textBoxIconPath.Text, textBoxProjectType.Text));
                        return;
                    }

                    _eventAggregator.Publish(new OpenProjectPackageEvent(textBoxPackagePath.Text, publishJob));
                    return;
                }
                _app.ExecuteAction <OpenPackageAction>();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
        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);
        }
Ejemplo n.º 3
0
        protected override void Execute()
        {
            try
            {
                var fileDialog = new OpenFileDialog {
                    Filter = "SDL packages (*.sdlppx)|*.sdlppx|SDL return packages (*.sdlrpx)|*.sdlrpx|World Server packages (*.wsxz)|*.wsxz"
                };
                if (fileDialog.ShowDialog() != true)
                {
                    return;
                }
                var filePath = fileDialog.FileName;

                var initialWizardSteps = new List <StudioWizardPage>
                {
                    new FirstPage(),
                    new SecondPage()
                };

                _eventAggregator.Publish(
                    new OpenProjectPackageEvent(
                        packageFilePath: filePath, job: null, iconPath: null, projectOrigin: null,
                        firstPages: initialWizardSteps));
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Ejemplo n.º 4
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 Execute()
        {
            IStudioEventAggregator ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var showNotification = new ShowStudioNotificationsViewEvent(true, true);

            ea.Publish(showNotification);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
 public void PublishEvent <TEvent>(TEvent sampleEvent)
 {
     _studioEventAggregator?.Publish(sampleEvent);
 }
Ejemplo n.º 8
0
 private void ClearNotification(SampleNotification notification)
 {
     _eventAggregator.Publish(new RemoveStudioNotificationFromGroupEvent(NotificationGroupId, notification.Id));
 }