public static void CheckNameUniqueness(this IAbstractEndpoint endpoint)
        {
            // If opening existing endpoint, return
            if (endpoint.As <IProductElement>().IsSerializing)
            {
                return;
            }

            var endpoints = endpoint.As <IProductElement>().Root.As <IApplication>().Design.Endpoints.GetAll();

            if (endpoints.Any(x => String.Compare(x.InstanceName, endpoint.InstanceName, true) == 0 && x != endpoint))
            {
                var error = "There is already an endpoint with the same name. Please, select a new name for your endpoint.";
                System.Windows.MessageBox.Show(error, "ServiceMatrix - New Endpoint Name Uniqueness", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
                throw new ElementAlreadyExistsException(error, endpoint.As <IProductElement>().DefinitionName, endpoint.InstanceName);
            }
        }
示例#2
0
        public void AddEndpointToUseCase(IAbstractEndpoint endpoint, IApplication application, IServiceProvider sp)
        {
            var command = new Commands.AddReferenceToUseCaseCommand {
                CurrentElement = endpoint.As <IProductElement>()
            };

            command.Execute();
        }
示例#3
0
        public void AddEndpointStartingUseCase(IAbstractEndpoint endpoint)
        {
            var element = endpoint.As <IProductElement>();

            this.EnsureRelatedElementListsExist();
            if (!this.UseCaseLinks.Any(l => l.LinkedElementId == element.Id))
            {
                this.InternalAddRelatedElement(element, true, true);
            }
        }
示例#4
0
        public void BuildDetailsForEndpoint(IAbstractEndpoint endpoint, ISolutionBuilderViewModel solutionBuilderModel)
        {
            var application   = endpoint.As <IProductElement>().Root.As <IApplication>();
            var allcomponents = application.Design.Services.Service.SelectMany(s => s.Components.Component);
            var components    = allcomponents.Where(c => endpoint.EndpointComponents.AbstractComponentLinks.Any(cl => cl.ComponentReference != null && cl.ComponentReference.Value == c));

            this.CleanDetails();

            // Components
            this.CreateComponentsPanelForEndpoint(solutionBuilderModel, components, endpoint.EndpointComponents.AbstractComponentLinks, 0);

            // Commands
            this.CreateCommandsPanel(solutionBuilderModel, components, 1);

            // Events
            this.CreateEventsPanel(solutionBuilderModel, components, 2);
        }
示例#5
0
 public void AddEndpointStartingUseCase(IAbstractEndpoint endpoint)
 {
     var element = endpoint.As<IProductElement>();
     this.EnsureRelatedElementListsExist();
     if (!this.UseCaseLinks.Any(l => l.LinkedElementId == element.Id))
     {
         this.InternalAddRelatedElement(element, true, true);
     }
 }
        public void BuildDetailsForEndpoint(IAbstractEndpoint endpoint, ISolutionBuilderViewModel solutionBuilderModel)
        {
            var application = endpoint.As<IProductElement>().Root.As<IApplication>();
            var allcomponents = application.Design.Services.Service.SelectMany(s => s.Components.Component);
            var components = allcomponents.Where(c => endpoint.EndpointComponents.AbstractComponentLinks.Any(cl => cl.ComponentReference != null && cl.ComponentReference.Value == c));

            this.CleanDetails();

            // Components
            this.CreateComponentsPanelForEndpoint(solutionBuilderModel, components, endpoint.EndpointComponents.AbstractComponentLinks, 0);

            // Commands
            this.CreateCommandsPanel(solutionBuilderModel, components, 1);

            // Events
            this.CreateEventsPanel(solutionBuilderModel, components, 2);

            // UseCases
            //this.CreateUseCasesPanel(solutionBuilderModel, endpoint.As<IProductElement>(), application, 3);
        }
示例#7
0
 public void AddEndpointToUseCase(IAbstractEndpoint endpoint, IApplication application, IServiceProvider sp)
 {
     var command = new Commands.AddReferenceToUseCaseCommand { CurrentElement = endpoint.As<IProductElement>()};
     command.Execute();
 }
 public static void RaiseOnInstantiated(this IAbstractEndpoint endpoint)
 {
     endpoint.As <IProductElement>().Root.As <IApplication>().RaiseOnInstantiatedEndpoint(endpoint);
 }
 public static void RaiseOnInitializing(this IAbstractEndpoint endpoint)
 {
     endpoint.As <IProductElement>().Root.As <IApplication>().RaiseOnInitializingEndpoint(endpoint);
 }