Ejemplo n.º 1
0
        private void AddAppService()
        {
            Messenger.Default.Register <NotificationMessageAction <Cloud> >(this,
                                                                            message =>
            {
                if (
                    message.Notification.Equals(
                        Messages.
                        SetAddApplicationServiceData))
                {
                    message.Execute(SelectedCloud);
                }
            });

            Messenger.Default.Send(new NotificationMessageAction <bool>(Messages.AddApplicationService, (confirmed) =>
                                                                        Messenger.Default
                                                                        .Send(
                                                                            new NotificationMessageAction
                                                                            <
                                                                                AddApplicationServiceViewModel
                                                                            >(
                                                                                Messages
                                                                                .
                                                                                GetAddApplicationServiceData,
                                                                                (
                                                                                    viewModel)
                                                                                =>
            {
                if
                (
                    !ApplicationServices
                    .
                    Contains
                        (viewModel
                        .
                        SelectedService,
                        new ProvisionedServiceEqualityComparer
                            ()))
                {
                    ApplicationServices
                    .
                    Add
                        (viewModel
                        .
                        SelectedService);
                }
            }))));
        }