示例#1
0
        internal InfrastructureNode AddInfrastructureNode(DeploymentNode parent, string name, string description, string technology, Dictionary <string, string> properties)
        {
            if (name == null || name.Trim().Length == 0)
            {
                throw new ArgumentException("A name must be specified.");
            }

            if (parent.GetDeploymentNodeWithName(name) == null && parent.GetInfrastructureNodeWithName(name) == null)
            {
                InfrastructureNode infrastructureNode = new InfrastructureNode
                {
                    Name        = name,
                    Description = description,
                    Technology  = technology,
                    Parent      = parent,
                    Environment = parent.Environment
                };

                if (properties != null)
                {
                    infrastructureNode.Properties = properties;
                }

                infrastructureNode.Id = IdGenerator.GenerateId(infrastructureNode);
                AddElementToInternalStructures(infrastructureNode);

                return(infrastructureNode);
            }
            else
            {
                throw new ArgumentException("A deployment/infrastructure node named '" + name + "' already exists.");
            }
        }
示例#2
0
        /// <summary>
        /// Adds a child infrastructure node.
        /// </summary>
        /// <param name="name">the name of the infrastructure node</param>
        /// <param name="description">a short description</param>
        /// <param name="technology">the technology</param>
        /// <param name="properties">a Dictionary (string,string) describing name=value properties</param>
        /// <returns>an InfrastructureNode object</returns>
        public InfrastructureNode AddInfrastructureNode(string name, string description, string technology, Dictionary <string, string> properties)
        {
            InfrastructureNode infrastructureNode = Model.AddInfrastructureNode(this, name, description, technology, properties);

            if (infrastructureNode != null)
            {
                _infrastructureNodes.Add(infrastructureNode);
            }
            return(infrastructureNode);
        }
示例#3
0
        /// <summary>
        /// Adds an infrastructure node (and its parent deployment nodes) to this view.
        /// </summary>
        /// <param name="infrastructureNode">the InfrastructureNode to add</param>
        public void Add(InfrastructureNode infrastructureNode)
        {
            AddElement(infrastructureNode, true);
            DeploymentNode parent = (DeploymentNode)infrastructureNode.Parent;

            while (parent != null)
            {
                AddElement(parent, true);
                parent = (DeploymentNode)parent.Parent;
            }
        }
示例#4
0
        /// <summary>
        /// Removes an infrastructure node from this view.
        /// </summary>
        /// <param name="infrastructureNode">the InfrastructureNode to remove</param>

        public void Remove(InfrastructureNode infrastructureNode)
        {
            RemoveElement(infrastructureNode);
        }
 /// <summary>
 /// Adds a relationship between this element instance and an infrastructure node.
 /// </summary>
 /// <param name="destination">the destination InfrastructureNode</param>
 /// <param name="description">a short description of the relationship</param>
 /// <param name="technology">the technology</param>
 /// <param name="interactionStyle">the interaction style (Synchronous vs Asynchronous)</param>
 /// <returns>a Relationship object</returns>
 public Relationship Uses(InfrastructureNode destination, string description, string technology, InteractionStyle?interactionStyle)
 {
     return(Model.AddRelationship(this, destination, description, technology, interactionStyle));
 }
 /// <summary>
 /// Adds a relationship between this element instance and an infrastructure node.
 /// </summary>
 /// <param name="destination">the destination InfrastructureNode</param>
 /// <param name="description">a short description of the relationship</param>
 /// <param name="technology">the technology</param>
 /// <returns>a Relationship object</returns>
 public Relationship Uses(InfrastructureNode destination, string description, string technology)
 {
     return(Uses(destination, description, technology, null));
 }
示例#7
0
        internal string Generate(InfrastructureNode infrastructureNode)
        {
            string deploymentNodeCanonicalName = Generate((DeploymentNode)infrastructureNode.Parent).Substring(DeploymentNodeType.Length);

            return(InfrastructureNodeType + deploymentNodeCanonicalName + DeploymentCanonicalNameSeperator + formatName(infrastructureNode));
        }