コード例 #1
0
ファイル: ServiceNode.cs プロジェクト: slamj1/ServiceMatrix
        public ServiceNode(IProductElementViewModel innerViewModel, EndpointNode parent)
            : base(innerViewModel)
        {
            this.SHAPE_MIN_HEIGHT = 130;
            this.Bounds = new Rect(12, 40, 296, this.SHAPE_MIN_HEIGHT);

            this.SetParent(parent);
        }
コード例 #2
0
ファイル: GroupNode.cs プロジェクト: slamj1/ServiceMatrix
        public GroupNode(IProductElementViewModel innerViewModel)
            : base(innerViewModel)
        {
            RotationChanged += new EventHandler(GroupNode_RotationChanged);
            this.IsResizable = false;

            this.ChildNodes = new List<GroupableNode>();
        }
コード例 #3
0
        public ComponentNode(IProductElementViewModel innerViewModel, ServiceNode parent)
            : base(innerViewModel)
        {
            this.IsResizable = false;

            this.Bounds = new Rect(12, 40, 276, 38);

            this.SetParent(parent);
        }
コード例 #4
0
        public MessageBaseNode(IProductElementViewModel innerViewModel)
            : base(innerViewModel)
        {
            ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Left));
            ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Right));

            this.IsResizable = false;
            this.Bounds = new Rect(0, 0, 320, 52);
        }
コード例 #5
0
        public GroupableNode(IProductElementViewModel innerViewModel)
        {
            this.InnerViewModel = innerViewModel;
            if (this.InnerViewModel != null)
            {
                this.InnerViewModel.Data.PropertyChanged += InnerViewModelData_PropertyChanged;
            }

            this.ZOrder = ++ZOrderCounter;
        }
コード例 #6
0
 private void WireInnerViewModel(IProductElementViewModel root)
 {
     this.InnerViewModel = root;
     this.InnerViewModel.PropertyChanged += (s, e) =>
         {
             if (e.PropertyName == "IsSelected")
             {
                 // this.IsSelected = this.InnerViewModel.IsSelected;
                 if (!this.IsNServiceBusView)
                 {
                     this.RaisePropertyChanged("IsSelected");
                 }
             }
         };
 }
コード例 #7
0
            // Methods
            public LogicalViewModelNode(
                LogicalViewModel viewModel,
                IProductElementViewModel root,
                ObservableCollection<IProductElementViewModel> children
                )
            {
                this.IsExpanded = true;
                this.ViewModel = viewModel;
                WireInnerViewModel(root);

                if (children != null)
                {
                    Func<IProductElementViewModel, LogicalViewModelNode> LogicalViewCreator = n =>
                        {
                            return new LogicalViewModelNode(viewModel, n, null);
                        };
                    this.LogicalViewNodes = new ObservableCollection<LogicalViewModelNode>(children.Select(n => LogicalViewCreator(n)));
                }
                else
                {
                    this.LogicalViewNodes = new ObservableCollection<LogicalViewModel.LogicalViewModelNode>();
                }

                if (!viewModel.IsMasterView)
                {
                    this.RemoveDeleteMenuItem();
                }
            }
コード例 #8
0
        public void SetView(IServiceProvider serviceProvider, IProductElementViewModel selectedElementViewModel, object logicalViewDataContext)
        {
            this.Caption = "ServiceMatrix Details - " + selectedElementViewModel.Data.InstanceName;
            if (this.CaptionHasChanged != null)
            {
                this.CaptionHasChanged(this, EventArgs.Empty);
            }

            var model = selectedElementViewModel.Data;
            string definitionName = model.DefinitionName.ToString();
            switch (definitionName)
            {
                case "Application":
                    this.ViewModel.BuildDetailsForApplication(model.As<IApplication>(), logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "NServiceBusHost":
                case "NServiceBusMVC":
                case "NServiceBusWeb":
                    this.ViewModel.BuildDetailsForEndpoint(model.As<IToolkitInterface>() as IAbstractEndpoint, logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "Component":
                    this.ViewModel.BuildDetailsForComponent(model.As<IComponent>(), logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "Command":
                    this.ViewModel.BuildDetailsForCommand(model.As<ICommand>(), logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "Event":
                    this.ViewModel.BuildDetailsForEvent(model.As<IEvent>(), logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "UseCase":
                    this.ViewModel.BuildDetailsForUseCase(model.As<IUseCase>(), logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                case "Library":
                case "ServiceLibrary":
                    this.ViewModel.BuildDetailsForLibrary(model, logicalViewDataContext as ISolutionBuilderViewModel);
                    break;
                default:
                    this.CleanDetails();
                    break;
            }
        }
コード例 #9
0
ファイル: ChildNode.cs プロジェクト: slamj1/ServiceMatrix
 public ChildNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
     ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Left));
     ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Right));
 }
コード例 #10
0
        private void RemoveComponentLink(IProductElementViewModel removedElement)
        {
            var componentViewModel = this.ViewModel.DeleteComponentLinkNode(removedElement);
            if (componentViewModel != null && componentViewModel.Data.Product != null)
            {
                this.ViewModel.GetOrCreateComponentNode(componentViewModel);

                var component = componentViewModel.Data.As<IComponent>();
                this.CreateComponentLinks(component);
            }
        }
コード例 #11
0
ファイル: MessageNode.cs プロジェクト: slamj1/ServiceMatrix
 public MessageNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
 }
コード例 #12
0
        private void AddElement(IProductElementViewModel newElement)
        {
            var elementType = newElement.Data.Info.Name;

            switch (elementType)
            {
                case "NServiceBusHost":
                case "NServiceBusMVC":
                case "NServiceBusWeb":
                    this.ViewModel.GetOrCreateEndpointNode(newElement);
                    break;
                case "Service":
                    this.ViewModel.GetOrCreateServiceNode(Guid.Empty, newElement);
                    break;
                case "Component":
                    this.ViewModel.GetOrCreateComponentNode(newElement);
                    break;
                case "Command":
                    this.ViewModel.GetOrCreateCommandNode(newElement);
                    break;
                case "Event":
                    this.ViewModel.GetOrCreateEventNode(newElement);
                    break;
                case "ComponentLink":
                    var componentLink = newElement.Data.As<IAbstractComponentLink>();
                    CreateComponentLink(componentLink);
                    break;

                // Connections
                case "CommandLink": // Component -> Command
                    var commandLink = newElement.Data.As<ICommandLink>();
                    CreateCommandLink(commandLink);
                    break;
                case "EventLink": // Component -> Event
                    var eventLink = newElement.Data.As<IEventLink>();
                    CreateEventLink(eventLink);
                    break;
                case "ProcessedCommandLink": // Command -> Component
                    var processedCommandLink = newElement.Data.As<IProcessedCommandLink>();
                    CreateProcessedCommandLink(processedCommandLink);
                    break;
                case "SubscribedEventLink": // Event -> Component
                    var subscribedEventLink = newElement.Data.As<ISubscribedEventLink>();
                    CreateSubscribedEventLink(subscribedEventLink);
                    break;

            }
        }
コード例 #13
0
 private void RemoveElement(IProductElementViewModel removedElement)
 {
     this.ViewModel.DeleteNodesById(removedElement.Data.Id);
 }
コード例 #14
0
        private void AddElement(IProductElementViewModel newElement)
        {
            var elementType = newElement.Data.Info.Name;

            switch (elementType)
            {
                case "Application":
                    newElement.ChildNodes.Traverse(x => x.ChildNodes).Where(x => x.Data.DefinitionName != "Service").ForEach (x => AddElement (x));
                    break;

                case "NServiceBusHost":
                case "NServiceBusMVC":
                case "NServiceBusWeb":
                    this.ViewModel.GetOrCreateEndpointNode(newElement);
                    break;
                case "Service":
                    this.ViewModel.GetOrCreateServiceNode(Guid.Empty, newElement);
                    break;
                case "Component":
                    this.ViewModel.GetOrCreateComponentNode(newElement);
                    break;
                case "Command":
                    this.ViewModel.GetOrCreateCommandNode(newElement);
                    break;
                case "Event":
                    this.ViewModel.GetOrCreateEventNode(newElement);
                    break;
                case "Message":
                    this.ViewModel.GetOrCreateMessageNode(newElement);
                    break;
                case "ComponentLink":
                    CreateComponentLink(newElement);
                    break;

                // Connections
                case "CommandLink": // Component -> Command
                    var commandLink = newElement.Data.As<ICommandLink>();
                    CreateCommandLink(commandLink);
                    break;
                case "EventLink": // Component -> Event
                    var eventLink = newElement.Data.As<IEventLink>();
                    CreateEventLink(eventLink);
                    break;
                case "ProcessedCommandLink": // Command -> Component
                    var processedCommandLink = newElement.Data.As<IProcessedCommandLink>();
                    CreateProcessedCommandLink(processedCommandLink);
                    break;
                case "SubscribedEventLink": // Event -> Component
                    var subscribedEventLink = newElement.Data.As<ISubscribedEventLink>();
                    CreateSubscribedEventLink(subscribedEventLink);
                    break;

                case "ProcessedCommandLinkReply": // Component -> Mesage
                    var processedCommandLinkReply = newElement.Data.As<IProcessedCommandLinkReply>();
                    CreateProcessedCommandLinkReply(processedCommandLinkReply);
                    break;

                case "HandledMessageLink": // Message -> Component
                    var handledMessageLink = newElement.Data.As<IHandledMessageLink>();
                    CreateHandledMessageLink(handledMessageLink);
                    break;
            }
        }
コード例 #15
0
ファイル: EndpointNode.cs プロジェクト: nanohex/ServiceMatrix
 public EndpointNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
     this.SHAPE_MIN_HEIGHT = 190;
     this.Bounds = new System.Windows.Rect(0, 0, 320, this.SHAPE_MIN_HEIGHT);
 }
コード例 #16
0
        private void CreateComponentLink(IProductElementViewModel viewModel)
        {
            var componentLink = viewModel.Data.As<IAbstractComponentLink>();
            var component = componentLink.ComponentReference.Value;
            var service = component.Parent.Parent;
            var serviceViewModel = FindViewModel(service.AsElement().Id);
            var componentViewModel = FindViewModel(component.AsElement().Id);

            this.ViewModel.GetOrCreateComponentLink(componentLink.ParentEndpointComponents.ParentEndpoint.As<NuPattern.Runtime.IProductElement>().Id,
                                                    serviceViewModel,
                                                    componentViewModel,
                                                    viewModel);

            CreateComponentLinks(component);
        }
コード例 #17
0
ファイル: EventNode.cs プロジェクト: slamj1/ServiceMatrix
 public EventNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
 }
コード例 #18
0
        private void RemoveElement(IProductElementViewModel removedElement)
        {
            switch (removedElement.Data.Info.Name)
            {
                case "NServiceBusHost":
                case "NServiceBusMVC":
                case "NServiceBusWeb":
                    foreach (var cl in removedElement.ChildNodes.First().ChildNodes)
                    {
                        RemoveComponentLink(cl);
                    }
                    break;
                case "ComponentLink":
                    RemoveComponentLink(removedElement);
                    break;

            }

            this.ViewModel.DeleteNodesById(removedElement.Data.Id);
        }
コード例 #19
0
ファイル: CommandNode.cs プロジェクト: slamj1/ServiceMatrix
 public CommandNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
 }