Beispiel #1
0
        protected override void Execute()
        {
            //create a unique identifier for the notification
            var notificationId = Guid.NewGuid();
            //create an instance of IStudioNotification
            var completeNotification = new StudioTestNotification(notificationId)
            {
                Title = "Another Sample Notification Title",
                AlwaysVisibleDetails = new List<string> { "This is a sample notification that will be added to an existing group or that will create a new one in case the group does not exist." },
                AllowsUserToDismiss = true,
                ClearNotificationAction = new ClearNotificationAction(NotificationGroupId, notificationId),
                IsExpanderVisible = false,
                IsLinkVisible = true,
                LinkAction = new OpenLinkCommand("https://appstore.sdl.com/language/developers/sdk.html")
                {
                    CommandText = "Learn more on the Studio 2019 SDK",
                    CommandToolTip = "Learn more on the Studio 2019 SDK"
                },
                IsActionVisible = false
            };

            //create an instance of the event
            var addTestGroup = new AddStudioNotificationOrCreateGroupEvent(NotificationGroupId, completeNotification, NotificationGroupTitle);
            //publish the event via the Event Aggregator
            var ea = SdlTradosStudio.Application.GetService<IStudioEventAggregator>();
            ea.Publish(addTestGroup);
        }
        protected override void Execute()
        {
            var ea = SdlTradosStudio.Application.GetService <IStudioEventAggregator>();

            var notificationGroup = new StudioTestNotificationsGroup(NotificationGroupId)
            {
                Title           = NotificationGroupTitle,
                IsActionVisible = true,
                Action          = new BasicCommand()
                {
                    CommandIcon = ImageResources.MyAction
                }
            };

            var notificationId       = Guid.NewGuid();
            var completeNotification = new StudioTestNotification(notificationId)
            {
                Title = "Sample Notification Title",
                AlwaysVisibleDetails = new List <string> {
                    "This is a sample notification that has all the elements of a notification visible"
                },
                OtherDetails = new List <string> {
                    "Use this section to display additional details within a notifcation.", "These details can be seen / hidden as per user needs"
                },
                AllowsUserToDismiss     = true,
                ClearNotificationAction = new ClearNotificationAction(NotificationGroupId, notificationId),
                IsExpanderVisible       = true,
                IsLinkVisible           = true,
                LinkAction = new OpenLinkCommand("https://appstore.sdl.com/language/developers/sdk.html")
                {
                    CommandText    = "Learn more on the Studio 2019 SDK",
                    CommandToolTip = "Learn more on the Studio 2019 SDK"
                },
                IsActionVisible = true,
                Action          = new BasicCommand()
                {
                    CommandText    = "Click me!",
                    CommandToolTip = "Click me!",
                    CommandIcon    = ImageResources.MyAction
                }
            };


            notificationGroup.Notifications.Add(completeNotification);

            var addTestGroup = new AddStudioGroupNotificationEvent(notificationGroup);

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

            var notificationGroup = new StudioTestNotificationsGroup(NotificationGroupId)
            {
                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(NotificationGroupId, notification1);

            ea.Publish(addTestNotification);

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

            ea.Publish(showNotification);
        }
        protected override void Execute()
        {
            var 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(NotificationGroupId, notification1);

            ea.Publish(addTestGroup1);

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

            ea.Publish(addTestGroup2);
        }