Beispiel #1
0
 public TViewFeatureViewModel(Feature feature, ElementViewModel parent)
 {
     this.feature = feature;
     this.Parent = parent;
     this.Name = feature.ToString();
     this.Children = null;
 }
Beispiel #2
0
        private static void CreateProductGroup(XElement element,out ProductGroup productGroup)
        {
            productGroup = new ProductGroup();
            var productGroupElementName = element.Element("productGroupName");
            if (productGroupElementName != null)
            {
                   productGroup.ProductGroupName = productGroupElementName.Value;
            }

            foreach (var productElement in element.Elements("product"))
            {
                var product = new Product ();
                product.Id = productElement.Attribute("id").Value;
                productGroup.Products.Add(product);
                var descriptionElement = productElement.Element("productDescription");
                if (descriptionElement != null)
                {
                    product.Description = descriptionElement.Value;
                }
                var nameElement = productElement.Element("productName");
                if (nameElement!=null)
                {
                    product.Name = nameElement.Value;
                }

                foreach (var versionElement in productElement.Elements("version"))
                {
                    var version = new Version ();
                    product.Versions.Add(version);
                    var versionNumberElement = versionElement.Element("versionNumber");
                    if (versionNumberElement != null)
                    {
                        version.VersionNumber = versionNumberElement.Value;
                    }
                    foreach (var feautureElement in versionElement.Elements("feature"))
                    {
                        var feauture = new Feature();
                        version.Features.Add(feauture);
                        var featureElementName = feautureElement.Element("featureName");
                        if (featureElementName != null)
                        {
                            feauture.Name = featureElementName.Value;
                        }
                        var feautureElementDescription = feautureElement.Element("featureDescription");
                        if (feautureElementDescription != null)
                        {
                            feauture.Description = feautureElementDescription.Value;
                        }
                    }
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// The greate product dummy.
        /// </summary>
        /// <returns>
        /// The <see cref="Product"/>.
        /// </returns>
        private static Product GreateProductDummy()
        {
            var featureA = new Feature { Description = "feature A Deskription", Name = "Feature A" };

            var featureB = new Feature { Description = "feature A Deskription", Name = "Feature B" };

            var featureC = new Feature { Description = "feature A Deskription", Name = "Feature C" };

            var fl = new List<Feature> { featureC, featureA, featureB };

            var product = new Product
                              {
                                  Id = "PJ1",
                                  Name = "Product J",
                                  Description = "Product J Description",

                              };
            return product;
        }