Exemple #1
0
        private void CreateCommandsPanel(ISolutionBuilderViewModel solutionBuilderModel, IEnumerable <IComponent> components, int position
                                         , IProductElement sent = null, IProductElement received = null)
        {
            var commandsVM = new InnerPanelViewModel();

            commandsVM.Title = "Commands";
            commandsVM.Items.Add(new InnerPanelTitle {
                Text = "Sent", Product = sent, MenuFilters = new string[] { "Send Command" }, ForceText = true
            });
            foreach (var publish in components.SelectMany(c => c.Publishes.CommandLinks.Select(cl => cl.CommandReference.Value)).Distinct())
            {
                commandsVM.Items.Add(new InnerPanelItem {
                    Product = publish.As <IProductElement>(), Text = publish.InstanceName
                });
            }
            commandsVM.Items.Add(new InnerPanelTitle {
                Text = "Received", ForceText = true
            });
            foreach (var subscribe in components.SelectMany(c => c.Subscribes.ProcessedCommandLinks.Select(cl => cl.CommandReference.Value)).Distinct())
            {
                commandsVM.Items.Add(new InnerPanelItem {
                    Product = subscribe.As <IProductElement>(), Text = subscribe.InstanceName
                });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
        }
Exemple #2
0
        private void CreateEventsPanel(ISolutionBuilderViewModel solutionBuilderModel, IEnumerable <IComponent> components, int position
                                       , IProductElement published = null, IProductElement subscribed = null)
        {
            var eventsVM = new InnerPanelViewModel();

            eventsVM.Title = "Events";
            eventsVM.Items.Add(new InnerPanelTitle {
                Text = "Published", Product = published, MenuFilters = new string[] { "Publish Event" }, ForceText = true
            });
            foreach (var publish in components.SelectMany(c => c.Publishes.EventLinks.Select(cl => cl.EventReference.Value)).Distinct())
            {
                eventsVM.Items.Add(new InnerPanelItem {
                    Product = publish.As <IProductElement>(), Text = publish.InstanceName
                });
            }
            eventsVM.Items.Add(new InnerPanelTitle {
                Text = "Subscribed", Product = subscribed, MenuFilters = new string[] { "Process Messages…" }, ForceText = true
            });
            foreach (var subscribe in components.SelectMany(c => c.Subscribes.SubscribedEventLinks.Select(cl => cl.EventReference.Value)).Distinct())
            {
                if (subscribe != null)
                {
                    eventsVM.Items.Add(new InnerPanelItem {
                        Product = subscribe.As <IProductElement>(), Text = subscribe.InstanceName
                    });
                }
                else
                {
                    eventsVM.Items.Add(new InnerPanelItem {
                        Product = null, Text = "[All the messages]"
                    });
                }
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, eventsVM)));
        }
Exemple #3
0
        private void CreateInfrastructurePanel(ISolutionBuilderViewModel solutionBuilderModel, IInfrastructure infrastructure, int position)
        {
            var infrastructureVM = new InnerPanelViewModel();

            infrastructureVM.Title = "Infrastructure";

            infrastructureVM.Items.Add(new InnerPanelTitle {
                Product = infrastructure.As <IProductElement>(), Text = infrastructure.InstanceName
            });

            if (infrastructure.Security != null)
            {
                infrastructureVM.Items.Add(new InnerPanelTitle {
                    Product = infrastructure.Security.As <IProductElement>(), Text = infrastructure.Security.InstanceName
                });
                if (infrastructure.Security.Authentication != null)
                {
                    infrastructureVM.Items.Add(new InnerPanelItem {
                        Product = infrastructure.Security.Authentication.As <IProductElement>(), Text = infrastructure.Security.Authentication.InstanceName
                    });
                }
            }

            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, infrastructureVM)));
        }
Exemple #4
0
        private void CreateComponentsPanelForEndpoint(ISolutionBuilderViewModel solutionBuilderModel,
                                                      IEnumerable <IComponent> components,
                                                      IEnumerable <IAbstractComponentLink> componentLinks,
                                                      int position,
                                                      string Preffix = "")
        {
            var componentsVM = new InnerPanelViewModel();

            componentsVM.Title = Preffix + "Components";
            foreach (var service in components.Select(c => c.Parent.Parent).Distinct())
            {
                componentsVM.Items.Add(new InnerPanelTitle {
                    Product = service.As <IProductElement>(), Text = service.InstanceName
                });
                foreach (var component in components.Where(c => c.Parent.Parent == service))
                {
                    componentsVM.Items.Add(new InnerPanelItem {
                        Product = component.As <IProductElement>(), Text = component.InstanceName
                    });
                }
            }

            var view = new ComponentsOrderingView();

            view.SetComponentsView(new LogicalView(new LogicalViewModel(solutionBuilderModel, componentsVM)));
            view.SetComponentLinks(componentLinks);
            this.SetPanel(position, view);
        }
Exemple #5
0
        private void CreateEndpointsUseCasePanel(IApplication application, ISolutionBuilderViewModel solutionBuilderModel, IUseCase useCase, int position)
        {
            var endpointsVM = new InnerPanelViewModel();

            endpointsVM.Title = "Deployed to the following Endpoints";
            endpointsVM.Items.Add(new InnerPanelTitle
            {
                Product     = useCase.As <IProductElement>(),
                Text        = "Started In",
                ForceText   = true,
                MenuFilters = new string[] { "Add Started By Endpoint" },
                IconPath    = solutionBuilderModel.FindNodeFor(useCase.Parent.As <IProductElement>()).IconPath
            });
            foreach (var endpoint in useCase.EndpointsStartingUseCases)
            {
                endpointsVM.Items.Add(new InnerPanelItem {
                    Product = endpoint.As <IProductElement>(), Text = endpoint.As <IProductElement>().InstanceName
                });
            }
            endpointsVM.Items.Add(new InnerPanelTitle
            {
                Product     = useCase.As <IProductElement>(),
                Text        = "Goes through",
                ForceText   = true,
                MenuFilters = new string[] { },
                IconPath    = solutionBuilderModel.FindNodeFor(useCase.Parent.As <IProductElement>()).IconPath
            });
            foreach (var endpoint in useCase.RelatedEndpoints)
            {
                endpointsVM.Items.Add(new InnerPanelItem {
                    Product = endpoint.As <IProductElement>(), Text = endpoint.As <IProductElement>().InstanceName
                });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, endpointsVM)));
        }
Exemple #6
0
        private void CreateComponentsForLibrary(ISolutionBuilderViewModel solutionBuilderModel, IApplication application, IProductElement library, int position)
        {
            var componentsVM = new InnerPanelViewModel();

            componentsVM.Title = "Used By Components";

            foreach (var service in application.Design.Services.Service
                     .Where(s => s.Components.Component
                            .Any(c => c.LibraryReferences.LibraryReference
                                 .Any(lr => lr.LibraryId == library.Id))))
            {
                componentsVM.Items.Add(new InnerPanelTitle
                {
                    Product     = service.As <IProductElement>(),
                    Text        = service.InstanceName,
                    ForceText   = true,
                    MenuFilters = new string[] { },
                    IconPath    = solutionBuilderModel.FindNodeFor(service.As <IProductElement>()).IconPath
                });
                foreach (var component in service.Components.Component
                         .Where(c => c.LibraryReferences.LibraryReference
                                .Any(lr => lr.LibraryId == library.Id)))
                {
                    componentsVM.Items.Add(new InnerPanelItem
                    {
                        Product = component.As <IProductElement>(),
                        Text    = component.InstanceName
                    });
                }
            }

            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, componentsVM)));
        }
Exemple #7
0
        private void CreateEventsForUseCasePanel(ISolutionBuilderViewModel solutionBuilderModel, IUseCase useCase, int position)
        {
            var events   = useCase.RelatedEvents;
            var eventsVM = new InnerPanelViewModel();

            eventsVM.Title = "Events";
            var eventsNode = new InnerPanelTitle
            {
                Product     = useCase.As <IProductElement>(),
                Text        = "Events",
                ForceText   = true,
                MenuFilters = new string[] { "Add Event" },
                IconPath    = solutionBuilderModel.FindNodeFor(useCase.Parent.As <IProductElement>()).IconPath
            };

            eventsVM.Items.Add(eventsNode);
            foreach (var service in events.Select(c => c.Parent.Parent.Parent).Distinct())
            {
                eventsVM.Items.Add(new InnerPanelTitle {
                    Product = service.As <IProductElement>(), Text = service.InstanceName
                });
                foreach (var @event in events.Where(c => c.Parent.Parent.Parent == service))
                {
                    eventsVM.Items.Add(new InnerPanelItem {
                        Product = @event.As <IProductElement>(), Text = @event.InstanceName
                    });
                }
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, eventsVM)));
        }
Exemple #8
0
        private void CreateLibrariesPanel(ISolutionBuilderViewModel solutionBuilderModel, IProductElement product, IApplication application, int position)
        {
            var commandsVM = new InnerPanelViewModel();

            commandsVM.Title = "Libraries";
            var globalLibraries = application.Design.Libraries.Library.Where(l =>
                                                                             product.As <IComponent>().LibraryReferences.LibraryReference
                                                                             .Any(lr => lr.LibraryId == l.As <IProductElement>().Id))
                                  .Select(l => l.As <IProductElement>());

            commandsVM.Items.Add(new InnerPanelTitle {
                Text = "Global Libraries", Product = null, MenuFilters = new string[] { }, ForceText = true
            });
            foreach (var gl in globalLibraries)
            {
                commandsVM.Items.Add(new InnerPanelItem {
                    Product = gl, Text = gl.InstanceName
                });
            }
            var serviceLibraries = product.As <IComponent>().Parent.Parent.ServiceLibraries.ServiceLibrary.Where(l =>
                                                                                                                 product.As <IComponent>().LibraryReferences.LibraryReference
                                                                                                                 .Any(lr => lr.LibraryId == l.As <IProductElement>().Id))
                                   .Select(l => l.As <IProductElement>());

            commandsVM.Items.Add(new InnerPanelTitle {
                Text = "Service Libraries", Product = null, MenuFilters = new string[] { }, ForceText = true
            });
            foreach (var sl in serviceLibraries)
            {
                commandsVM.Items.Add(new InnerPanelItem {
                    Product = sl, Text = sl.InstanceName
                });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
        }
Exemple #9
0
        public LogicalViewModel(ISolutionBuilderViewModel sourceViewModel, InnerPanelViewModel innerView)
        {
            this.Title = innerView.Title;
            this.WireSolutionBuilderViewModel(sourceViewModel, true);
            this.LogicalViewNodes = new ObservableCollection <LogicalViewModelNode>();
            IProductElementViewModel root        = null;
            IEnumerable <string>     menuFilters = null;
            InnerPanelItem           rootItem    = null;
            ObservableCollection <IProductElementViewModel> children = new ObservableCollection <IProductElementViewModel>();

            foreach (InnerPanelItem item in innerView.Items)
            {
                if (item is InnerPanelTitle)
                {
                    if (root != null)
                    {
                        var rootNode = new LogicalViewModelNode(this, root, children)
                        {
                            CustomIconPath = rootItem.IconPath
                        };
                        if (menuFilters != null)
                        {
                            rootNode.FilterMenuItems(menuFilters.ToArray());
                        }
                        this.LogicalViewNodes.Add(rootNode);
                    }
                    rootItem    = item;
                    root        = this.GetProductNode(item);
                    menuFilters = (item as InnerPanelTitle).MenuFilters;
                    children    = new ObservableCollection <IProductElementViewModel>();
                }
                else
                {
                    children.Add(this.GetProductNode(item));
                }
            }
            if (root != null)
            {
                var rootNode = new LogicalViewModelNode(this, root, children)
                {
                    CustomIconPath = rootItem.IconPath
                };
                if (menuFilters != null)
                {
                    rootNode.FilterMenuItems(menuFilters.ToArray());
                }
                this.LogicalViewNodes.Add(rootNode);
            }
        }
Exemple #10
0
        private void CreateEndpointsPanel(IApplication application, ISolutionBuilderViewModel solutionBuilderModel, IEnumerable <IAbstractEndpoint> endpoints, int position)
        {
            var endpointsVM = new InnerPanelViewModel();

            endpointsVM.Title = "Deployed to the following Endpoints";
            endpointsVM.Items.Add(new InnerPanelTitle {
                Product = application.As <IProductElement>(), Text = application.InstanceName
            });
            foreach (var endpoint in endpoints)
            {
                endpointsVM.Items.Add(new InnerPanelItem {
                    Product = endpoint.As <IProductElement>(), Text = endpoint.As <IProductElement>().InstanceName
                });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, endpointsVM)));
        }
 public LogicalViewModel(ISolutionBuilderViewModel sourceViewModel, InnerPanelViewModel innerView)
 {
     this.Title = innerView.Title;
     this.WireSolutionBuilderViewModel(sourceViewModel, true);
     this.LogicalViewNodes = new ObservableCollection<LogicalViewModelNode>();
     IProductElementViewModel root = null;
     IEnumerable<string> menuFilters = null;
     InnerPanelItem rootItem = null;
     ObservableCollection<IProductElementViewModel> children = new ObservableCollection<IProductElementViewModel>();
     foreach (InnerPanelItem item in innerView.Items)
     {
         if (item is InnerPanelTitle)
         {
             if (root != null)
             {
                 var rootNode = new LogicalViewModelNode(this, root, children) { CustomIconPath = rootItem.IconPath };
                 if (menuFilters != null)
                 {
                     rootNode.FilterMenuItems(menuFilters.ToArray());
                 }
                 this.LogicalViewNodes.Add(rootNode);
             }
             rootItem = item;
             root = this.GetProductNode(item);
             menuFilters = (item as InnerPanelTitle).MenuFilters;
             children = new ObservableCollection<IProductElementViewModel>();
         }
         else
         {
             children.Add(this.GetProductNode(item));
         }
     }
     if (root != null)
     {
         var rootNode = new LogicalViewModelNode(this, root, children) { CustomIconPath = rootItem.IconPath };
         if (menuFilters != null)
         {
             rootNode.FilterMenuItems(menuFilters.ToArray());
         }
         this.LogicalViewNodes.Add(rootNode);
     }
 }
Exemple #12
0
        private void CreateUseCasesPanel(ISolutionBuilderViewModel solutionBuilderModel, IProductElement product, IApplication application, int position)
        {
            var commandsVM = new InnerPanelViewModel();

            commandsVM.Title = "Use Cases";
            var useCases = application.Design.UseCases.UseCase.Where(uc => uc.UseCaseLinks.Any(ul => ul.LinkedElementId == product.Id))
                           .Union(application.Design.UseCases.UseCase.Where(uc => uc.RelatedEndpoints.Any(ep => ep.As <IProductElement>().Id == product.Id)))
                           .Distinct();

            commandsVM.Items.Add(new InnerPanelTitle {
                Text = "Participates in", Product = null, MenuFilters = new string[] { }, ForceText = true
            });
            foreach (var usecase in useCases)
            {
                commandsVM.Items.Add(new InnerPanelItem {
                    Product = usecase.As <IProductElement>(), Text = usecase.InstanceName
                });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
        }
 private void CreateEventsPanel(ISolutionBuilderViewModel solutionBuilderModel, IEnumerable<IComponent> components, int position
     , IProductElement published = null, IProductElement subscribed = null)
 {
     var eventsVM = new InnerPanelViewModel();
     eventsVM.Title = "Events";
     eventsVM.Items.Add(new InnerPanelTitle { Text = "Published", Product = published, MenuFilters = new string[] { "Publish Event" }, ForceText = true });
     foreach (var publish in components.SelectMany(c => c.Publishes.EventLinks.Select(cl => cl.EventReference.Value)).Distinct())
     {
         eventsVM.Items.Add(new InnerPanelItem { Product = publish.As<IProductElement>(), Text = publish.InstanceName });
     }
     eventsVM.Items.Add(new InnerPanelTitle { Text = "Subscribed", Product = subscribed, MenuFilters = new string[] { "Process Messages…" }, ForceText = true });
     foreach (var subscribe in components.SelectMany(c => c.Subscribes.SubscribedEventLinks.Select(cl => cl.EventReference.Value)).Distinct())
     {
         if (subscribe != null)
         {
             eventsVM.Items.Add(new InnerPanelItem { Product = subscribe.As<IProductElement>(), Text = subscribe.InstanceName });
         }
         else
         {
             eventsVM.Items.Add(new InnerPanelItem { Product = null, Text = "[All the messages]" });
         }
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, eventsVM)));
 }
        private void CreateComponentsForLibrary(ISolutionBuilderViewModel solutionBuilderModel, IApplication application, IProductElement library, int position)
        {
            var componentsVM = new InnerPanelViewModel();
            componentsVM.Title = "Used By Components";

            foreach (var service in application.Design.Services.Service
                                        .Where(s => s.Components.Component
                                            .Any(c => c.LibraryReferences.LibraryReference
                                                .Any(lr => lr.LibraryId == library.Id))))
            {
                componentsVM.Items.Add(new InnerPanelTitle
                {
                    Product = service.As<IProductElement>(),
                    Text = service.InstanceName,
                    ForceText = true,
                    MenuFilters = new string[] { },
                    IconPath = solutionBuilderModel.FindNodeFor(service.As<IProductElement>()).IconPath
                });
                foreach (var component in service.Components.Component
                                            .Where(c => c.LibraryReferences.LibraryReference
                                                .Any(lr => lr.LibraryId == library.Id)))
                {
                    componentsVM.Items.Add(new InnerPanelItem
                    {
                        Product = component.As<IProductElement>(),
                        Text = component.InstanceName
                    });
                }
            }

            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, componentsVM)));
        }
 private void CreateCommandsPanel(ISolutionBuilderViewModel solutionBuilderModel, IEnumerable<IComponent> components, int position
     , IProductElement sent = null, IProductElement received = null)
 {
     var commandsVM = new InnerPanelViewModel();
     commandsVM.Title = "Commands";
     commandsVM.Items.Add(new InnerPanelTitle { Text = "Sent", Product = sent, MenuFilters = new string[] { "Send Command" }, ForceText = true });
     foreach (var publish in components.SelectMany(c => c.Publishes.CommandLinks.Select(cl => cl.CommandReference.Value)).Distinct())
     {
         commandsVM.Items.Add(new InnerPanelItem { Product = publish.As<IProductElement>(), Text = publish.InstanceName });
     }
     commandsVM.Items.Add(new InnerPanelTitle { Text = "Received", ForceText = true });
     foreach (var subscribe in components.SelectMany(c => c.Subscribes.ProcessedCommandLinks.Select(cl => cl.CommandReference.Value)).Distinct())
     {
         commandsVM.Items.Add(new InnerPanelItem { Product = subscribe.As<IProductElement>(), Text = subscribe.InstanceName });
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
 }
 private void CreateEndpointsPanel(IApplication application, ISolutionBuilderViewModel solutionBuilderModel, IEnumerable<IAbstractEndpoint> endpoints, int position)
 {
     var endpointsVM = new InnerPanelViewModel();
     endpointsVM.Title = "Deployed to the following Endpoints";
     endpointsVM.Items.Add(new InnerPanelTitle { Product = application.As<IProductElement>(), Text = application.InstanceName });
     foreach (var endpoint in endpoints)
     {
         endpointsVM.Items.Add(new InnerPanelItem { Product = endpoint.As<IProductElement>(), Text = endpoint.As<IProductElement>().InstanceName });
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, endpointsVM)));
 }
        private void CreateComponentsPanelForEndpoint(ISolutionBuilderViewModel solutionBuilderModel, 
            IEnumerable<IComponent> components,
            IEnumerable<IAbstractComponentLink> componentLinks,
            int position,
            string Preffix = "")
        {
            var componentsVM = new InnerPanelViewModel();
            componentsVM.Title = Preffix + "Components";
            foreach (var service in components.Select(c => c.Parent.Parent).Distinct())
            {
                componentsVM.Items.Add(new InnerPanelTitle { Product = service.As<IProductElement>(), Text = service.InstanceName });
                foreach (var component in components.Where(c => c.Parent.Parent == service))
                {
                    componentsVM.Items.Add(new InnerPanelItem { Product = component.As<IProductElement>(), Text = component.InstanceName });
                }
            }

            var view = new ComponentsOrderingView();
            view.SetComponentsView(new LogicalView(new LogicalViewModel(solutionBuilderModel, componentsVM)));
            view.SetComponentLinks(componentLinks);
            this.SetPanel(position, view);
        }
 private void CreateEndpointsUseCasePanel(IApplication application, ISolutionBuilderViewModel solutionBuilderModel, IUseCase useCase, int position)
 {
     var endpointsVM = new InnerPanelViewModel();
     endpointsVM.Title = "Deployed to the following Endpoints";
     endpointsVM.Items.Add(new InnerPanelTitle
     {
         Product = useCase.As<IProductElement>(),
         Text = "Started In",
         ForceText = true,
         MenuFilters = new string[] { "Add Started By Endpoint" },
         IconPath = solutionBuilderModel.FindNodeFor(useCase.Parent.As<IProductElement>()).IconPath
     });
     foreach (var endpoint in useCase.EndpointsStartingUseCases)
     {
         endpointsVM.Items.Add(new InnerPanelItem { Product = endpoint.As<IProductElement>(), Text = endpoint.As<IProductElement>().InstanceName });
     }
     endpointsVM.Items.Add(new InnerPanelTitle
     {
         Product = useCase.As<IProductElement>(),
         Text = "Goes through",
         ForceText = true,
         MenuFilters = new string[] { },
         IconPath = solutionBuilderModel.FindNodeFor(useCase.Parent.As<IProductElement>()).IconPath
     });
     foreach (var endpoint in useCase.RelatedEndpoints)
     {
         endpointsVM.Items.Add(new InnerPanelItem { Product = endpoint.As<IProductElement>(), Text = endpoint.As<IProductElement>().InstanceName });
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, endpointsVM)));
 }
 private void CreateEventsForUseCasePanel(ISolutionBuilderViewModel solutionBuilderModel, IUseCase useCase, int position)
 {
     var events = useCase.RelatedEvents;
     var eventsVM = new InnerPanelViewModel();
     eventsVM.Title = "Events";
     var eventsNode = new InnerPanelTitle
     {
         Product = useCase.As<IProductElement>(),
         Text = "Events",
         ForceText = true,
         MenuFilters = new string[] { "Add Event" },
         IconPath = solutionBuilderModel.FindNodeFor(useCase.Parent.As<IProductElement>()).IconPath
     };
     eventsVM.Items.Add(eventsNode);
     foreach (var service in events.Select(c => c.Parent.Parent.Parent).Distinct())
     {
         eventsVM.Items.Add(new InnerPanelTitle { Product = service.As<IProductElement>(), Text = service.InstanceName });
         foreach (var @event in events.Where(c => c.Parent.Parent.Parent == service))
         {
             eventsVM.Items.Add(new InnerPanelItem { Product = @event.As<IProductElement>(), Text = @event.InstanceName });
         }
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, eventsVM)));
 }
        private void CreateUseCasesPanel(ISolutionBuilderViewModel solutionBuilderModel, IProductElement product, IApplication application, int position)
        {
            var commandsVM = new InnerPanelViewModel();
            commandsVM.Title = "Use Cases";
            var useCases = application.Design.UseCases.UseCase.Where(uc => uc.UseCaseLinks.Any(ul => ul.LinkedElementId == product.Id))
                .Union(application.Design.UseCases.UseCase.Where(uc => uc.RelatedEndpoints.Any(ep => ep.As<IProductElement>().Id == product.Id)))
                .Distinct();

            commandsVM.Items.Add(new InnerPanelTitle { Text = "Participates in", Product = null, MenuFilters = new string[] { }, ForceText = true });
            foreach (var usecase in useCases)
            {
                commandsVM.Items.Add(new InnerPanelItem { Product = usecase.As<IProductElement>(), Text = usecase.InstanceName });
            }
            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
        }
 private void CreateLibrariesPanel(ISolutionBuilderViewModel solutionBuilderModel, IProductElement product, IApplication application, int position)
 {
     var commandsVM = new InnerPanelViewModel();
     commandsVM.Title = "Libraries";
     var globalLibraries = application.Design.Libraries.Library.Where(l =>
                                     product.As<IComponent>().LibraryReferences.LibraryReference
                                             .Any(lr => lr.LibraryId == l.As<IProductElement>().Id))
                                     .Select(l => l.As<IProductElement>());
     commandsVM.Items.Add(new InnerPanelTitle { Text = "Global Libraries", Product = null, MenuFilters = new string[] { }, ForceText = true });
     foreach (var gl in globalLibraries)
     {
         commandsVM.Items.Add(new InnerPanelItem { Product = gl, Text = gl.InstanceName });
     }
     var serviceLibraries = product.As<IComponent>().Parent.Parent.ServiceLibraries.ServiceLibrary.Where(l =>
                                     product.As<IComponent>().LibraryReferences.LibraryReference
                                             .Any(lr => lr.LibraryId == l.As<IProductElement>().Id))
                                     .Select(l => l.As<IProductElement>());
     commandsVM.Items.Add(new InnerPanelTitle { Text = "Service Libraries", Product = null, MenuFilters = new string[] { }, ForceText = true });
     foreach (var sl in serviceLibraries)
     {
         commandsVM.Items.Add(new InnerPanelItem { Product = sl, Text = sl.InstanceName });
     }
     this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, commandsVM)));
 }
        private void CreateInfrastructurePanel(ISolutionBuilderViewModel solutionBuilderModel, IInfrastructure infrastructure, int position)
        {
            var infrastructureVM = new InnerPanelViewModel();
            infrastructureVM.Title = "Infrastructure";

            infrastructureVM.Items.Add(new InnerPanelTitle { Product = infrastructure.As<IProductElement>(), Text = infrastructure.InstanceName });

            if (infrastructure.Security != null)
            {
                infrastructureVM.Items.Add(new InnerPanelTitle { Product = infrastructure.Security.As<IProductElement>(), Text = infrastructure.Security.InstanceName });
                if (infrastructure.Security.Authentication != null)
                {
                    infrastructureVM.Items.Add(new InnerPanelItem { Product = infrastructure.Security.Authentication.As<IProductElement>(), Text = infrastructure.Security.Authentication.InstanceName });
                }
            }

            this.SetPanel(position, new LogicalView(new LogicalViewModel(solutionBuilderModel, infrastructureVM)));
        }