Skip to content

Commit

Permalink
(chocolateyGH-10) Packages.config file
Browse files Browse the repository at this point in the history
Configuration for serializing values for the config file.
  • Loading branch information
ferventcoder committed Jan 25, 2015
1 parent 45fca0c commit 7505c18
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chocolatey/chocolatey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
<Compile Include="infrastructure.app\commands\ChocolateyUninstallCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyUpgradeCommand.cs" />
<Compile Include="infrastructure.app\configuration\ConfigFileFeatureSetting.cs" />
<Compile Include="infrastructure.app\configuration\PackagesConfigFilePackageSetting.cs" />
<Compile Include="infrastructure.app\configuration\PackagesConfigFileSettings.cs" />
<Compile Include="infrastructure.app\domain\PinCommandType.cs" />
<Compile Include="infrastructure.app\domain\SourceCommandType.cs" />
<Compile Include="infrastructure.app\messages\PostRunEvent.cs" />
Expand Down Expand Up @@ -252,4 +254,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// XML packages.config file package element
/// </summary>
[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; }
}
}
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// XML packages.config configuration file
/// </summary>
[Serializable]
[XmlRoot("chocolatey")]
public class PackagesConfigFileSettings
{
[XmlArray("packages")]
public HashSet<PackagesConfigFilePackageSetting> Packages { get; set; }
}
}

0 comments on commit 7505c18

Please sign in to comment.