From 7505c186daceb4a74f6af0773d130066625341cd Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 25 Jan 2015 17:56:05 -0600 Subject: [PATCH] (GH-10) Packages.config file Configuration for serializing values for the config file. --- src/chocolatey/chocolatey.csproj | 4 +- .../PackagesConfigFilePackageSetting.cs | 55 +++++++++++++++++++ .../PackagesConfigFileSettings.cs | 32 +++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs create mode 100644 src/chocolatey/infrastructure.app/configuration/PackagesConfigFileSettings.cs diff --git a/src/chocolatey/chocolatey.csproj b/src/chocolatey/chocolatey.csproj index 1162392b32..c2455dfb2d 100644 --- a/src/chocolatey/chocolatey.csproj +++ b/src/chocolatey/chocolatey.csproj @@ -88,6 +88,8 @@ + + @@ -252,4 +254,4 @@ --> - + \ No newline at end of file diff --git a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs new file mode 100644 index 0000000000..8d0f1db9ab --- /dev/null +++ b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs @@ -0,0 +1,55 @@ +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.infrastructure.app.configuration +{ + using System; + using System.Xml.Serialization; + + /// + /// XML packages.config file package element + /// + [Serializable] + [XmlType("package")] + public sealed class PackagesConfigFilePackageSetting + { + [XmlAttribute(AttributeName = "id")] + public string Id { get; set; } + + [XmlAttribute(AttributeName = "source")] + public string Source { get; set; } + + [XmlAttribute(AttributeName = "version")] + public string Version { get; set; } + + [XmlAttribute(AttributeName = "installArguments")] + public string InstallArguments { get; set; } + + [XmlAttribute(AttributeName = "packageParameters")] + public string PackageParameters { get; set; } + + [XmlAttribute(AttributeName = "forceX86")] + public bool ForceX86 { get; set; } + + [XmlAttribute(AttributeName = "allowMultipleVersions")] + public bool AllowMultipleVersions { get; set; } + + [XmlAttribute(AttributeName = "ignoreDependencies")] + public bool IgnoreDependencies { get; set; } + + [XmlAttribute(AttributeName = "disabled")] + public bool Disabled { get; set; } + } +} \ No newline at end of file diff --git a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFileSettings.cs b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFileSettings.cs new file mode 100644 index 0000000000..2065fc33e9 --- /dev/null +++ b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFileSettings.cs @@ -0,0 +1,32 @@ +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.infrastructure.app.configuration +{ + using System; + using System.Collections.Generic; + using System.Xml.Serialization; + + /// + /// XML packages.config configuration file + /// + [Serializable] + [XmlRoot("chocolatey")] + public class PackagesConfigFileSettings + { + [XmlArray("packages")] + public HashSet Packages { get; set; } + } +} \ No newline at end of file