public PackageViewModel(PackageReader reader) { _reader = reader; SourcePackageViewModel=new PackageViewModel() { Name = reader.GetRulesSourcePropertyValueByName(Package, "name"), DisplayName = reader.GetRulesSourcePropertyValueByName(Package, "display-name"), Architecture = reader.GetRulesSourcePropertyValueByName(Package, "arch"), Feed = reader.GetRulesSourcePropertyValueByName(Package, "feed"), Location = reader.GetRulesSourcePropertyValueByName(Package, "location"), Publisher = reader.GetRulesSourcePropertyValueByName(Package, "publisher"), Version = reader.GetRulesSourcePropertyValueByName(Package, "version"), IsEditable = true, IsSource = true, }; Name = reader.GetRulesPropertyValueByName(Package, "name"); DisplayName = reader.GetRulesPropertyValueByName(Package, "display-name"); Architecture = reader.GetRulesPropertyValueByName(Package, "arch"); Feed = reader.GetRulesPropertyValueByName(Package, "feed"); Location = reader.GetRulesPropertyValueByName(Package, "location"); Publisher = reader.GetRulesPropertyValueByName(Package, "publisher"); Version = reader.GetRulesPropertyValueByName(Package, "version"); IsEditable = false; SourceString = reader.GetRulesSourceStringPropertyValueByName(Package); SourcePackageViewModel.PropertyChanged += EvaluatedChanged; }
public CompatibilityPolicyViewModel(PackageReader reader) { _reader = reader; Minimum = reader.GetRulesPropertyValueByName(CompatibilityPolicy, "minimum"); Maximum = reader.GetRulesPropertyValueByName(CompatibilityPolicy, "maximum"); Versions = reader.GetRulesPropertyValueByName(CompatibilityPolicy, "versions"); IsEditable = false; SourceValueCompatibilityPolicyViewModel = new CompatibilityPolicyViewModel() { Minimum = reader.GetRulesSourcePropertyValueByName(CompatibilityPolicy, "minimum"), Maximum = reader.GetRulesSourcePropertyValueByName(CompatibilityPolicy, "maximum"), Versions = reader.GetRulesSourcePropertyValueByName(CompatibilityPolicy, "versions"), IsEditable = true, IsSource = true, }; SourceString = reader.GetRulesSourceStringPropertyValueByName(CompatibilityPolicy); SourceValueCompatibilityPolicyViewModel.PropertyChanged += EvaluatedChanged; }
public MetadataViewModel(PackageReader reader) { _reader = reader; Summary = reader.GetRulesPropertyValueByName(Metadata, "summary"); Description = reader.GetRulesPropertyValueByName(Metadata, "description"); AuthorVersion = reader.GetRulesPropertyValueByName(Metadata, "author-version"); BugTracker = reader.GetRulesPropertyValueByName(Metadata, "bug-tracker"); Stability = reader.GetRulesPropertyValueByName(Metadata, "stability"); Licenses = reader.GetRulesPropertyValueByName(Metadata, "licenses"); IsEditable = false; SourceMetadataViewModel = new MetadataViewModel() { Summary = reader.GetRulesSourcePropertyValueByName(Metadata, "summary"), Description = reader.GetRulesSourcePropertyValueByName(Metadata, "description"), AuthorVersion = reader.GetRulesSourcePropertyValueByName(Metadata, "author-version"), BugTracker = reader.GetRulesSourcePropertyValueByName(Metadata, "bug-tracker"), Stability = reader.GetRulesSourcePropertyValueByName(Metadata, "stability"), Licenses = reader.GetRulesSourcePropertyValueByName(Metadata, "licenses"), IsEditable = true, IsSource = true, }; SourceString = reader.GetRulesSourceStringPropertyValueByName(Metadata); SourceMetadataViewModel.PropertyChanged += EvaluatedChanged; }
public LicenseViewModel(PackageReader reader) { _reader = reader; License = reader.GetRulesPropertyValueByName(LicenseString, "license"); LicenseType = reader.GetRulesPropertyValueByName(LicenseString, "license-type"); LicenseUrl = reader.GetRulesPropertyValueByName(LicenseString, "license-url"); _sourceValueLicenseViewModel = new LicenseViewModel() { License = reader.GetRulesSourcePropertyValueByName(LicenseString, "license"), LicenseType = reader.GetRulesSourcePropertyValueByName(LicenseString, "license-type"), LicenseUrl = reader.GetRulesSourcePropertyValueByName(LicenseString, "license-url"), IsEditable = true, IsSource = true, }; SourceString = reader.GetRulesSourceStringPropertyValueByName(LicenseString); SourceValueLicenseViewModel.PropertyChanged += EvaluatedChanged; }
public SigningViewModel(PackageReader reader) { _reader = reader; ReplaceSignature = _reader.GetRulesPropertyValueByName(Signing, "replace-signature") == "true"; CompanyAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "company",false); DescriptionAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "description",false); ProductNameAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "product-name",false); ProductVersion = reader.GetRulesByNameForSigning(Signing, "attributes", "product-version",false); FileVersionAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "file-version",false); EditCollectionViewModel = new EditCollectionViewModel(reader, reader.GetRulesSourceValuesByNameForEditableCollections(Signing, "include")); IsEditable = false; IsReadOnly = true; SourceSigningViewModel = new SigningViewModel() { ReplaceSignature = _reader.GetRulesSourcePropertyValueByName(Signing, "replace-signature") == "true", CompanyAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "company", true), DescriptionAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "description", true), ProductNameAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "product-name", true), ProductVersion = reader.GetRulesByNameForSigning(Signing, "attributes", "product-version", true), FileVersionAttribute = reader.GetRulesByNameForSigning(Signing, "attributes", "file-version", true), EditCollectionViewModel = this.EditCollectionViewModel, IsEditable = true, IsReadOnly = false, IsSource = true, }; SourceString = reader.GetRulesSourceStringPropertyValueByName(Signing); SourceSigningViewModel.PropertyChanged += EvaluatedChanged; }
private void CreateModels(PackageReader reader) { string package = "package"; _packageViewModel = new PackageViewModel() { Name = reader.GetRulesPropertyValueByName(package, "name"), DisplayName = reader.GetRulesPropertyValueByName(package, "display-name"), Architecture = reader.GetRulesPropertyValueByName(package, "arch"), Feed = reader.GetRulesPropertyValueByName(package, "feed"), Location = reader.GetRulesPropertyValueByName(package, "location"), Publisher = reader.GetRulesPropertyValueByName(package, "publisher"), Version = reader.GetRulesPropertyValueByName(package, "version") }; string metadata = "metadata"; _metadataViewModel = new MetadataViewModel() { Summary = reader.GetRulesPropertyValueByName(metadata, "summary"), Description = reader.GetRulesPropertyValueByName(metadata, "description"), AuthorVersion = reader.GetRulesPropertyValueByName(metadata, "author-version"), BugTracker = reader.GetRulesPropertyValueByName(metadata, "bug-tracker"), Stability = reader.GetRulesPropertyValueByName(metadata, "stability"), Licenses = reader.GetRulesPropertyValueByName(metadata, "licenses"), }; //_requiresViewModel = new RequiresViewModel() //{ // RequiredPackages = new ObservableCollection<Package>() //}; _packageCompositionViewModel = new PackageCompositionViewModel() { Symlinks = reader.GetRulesPropertyValueByName("package-composition", "symlinks") }; _packageCompositionViewModel = new PackageCompositionViewModel() { Symlinks = reader.GetRulesPropertyValueByName("package-composition", "symlinks") }; _filesCollection = new ObservableCollection<FilesViewModel>(); foreach (string parameter in reader.ReadFilesParameters()) { ObservableCollection<string> collection = new ObservableCollection<string>(reader.GetFilesIncludeList(parameter)); FilesViewModel model = new FilesViewModel(parameter) { Root = reader.GetFilesRulesPropertyValueByParameterAndName(parameter,"root"), TrimPath = reader.GetFilesRulesPropertyValueByParameterAndName(parameter, "trim-path"), Include = collection }; _filesCollection.Add(model); } }
public object CreateInstance(PackageReader reader) { string package = "package"; PackageViewModel model=new PackageViewModel(reader) { Name = reader.GetRulesPropertyValueByName(package, "name"), DisplayName = reader.GetRulesPropertyValueByName(package, "display-name"), Architecture = reader.GetRulesPropertyValueByName(package, "arch"), Feed = reader.GetRulesPropertyValueByName(package, "feed"), Location = reader.GetRulesPropertyValueByName(package, "location"), Publisher = reader.GetRulesPropertyValueByName(package, "publisher"), Version = reader.GetRulesPropertyValueByName(package, "version") }; return model; }