コード例 #1
0
ファイル: TViewVersionViewModel.cs プロジェクト: dk0104/Demo
 //---------------------------------------------------------------------
 public TViewVersionViewModel(Version version, ElementViewModel parent)
 {
     this.version = version;
     this.Parent = parent;
     this.Name = version.ToString();
     this.Children = new ReadOnlyCollection<ElementViewModel>((from feature in this.version.Features
                                                                select new TViewFeatureViewModel(feature, this)).ToList<ElementViewModel>()).ToList();
 }
コード例 #2
0
        public void CreateVersionNumber()
        {
            using (CodeAnalyzerContainer context = new CodeAnalyzerContainer())
            {
                // Mapping: Domain Model => Entity Model.
                Model.Version v = new Model.Version {
                    VersionNumber = Ids.DATABASE_VERSION_NUMBER
                };

                // Do the actual DB update.
                context.Version.Add(v);
                context.SaveChanges();
            }
        }
コード例 #3
0
ファイル: XmlFileReader.cs プロジェクト: dk0104/Demo
        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;
                        }
                    }
                }
            }
        }
コード例 #4
0
        public void CreateVersionNumber()
        {
            using (CodeAnalyzerContainer context = new CodeAnalyzerContainer())
              {
            // Mapping: Domain Model => Entity Model.
              Model.Version v = new Model.Version { VersionNumber = Ids.DATABASE_VERSION_NUMBER };

              // Do the actual DB update.
            context.Version.Add(v);
            context.SaveChanges();
              }
        }