Skip to content

Commit

Permalink
(GH-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 Feb 4, 2015
1 parent 7733bdf commit 8d69788
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chocolatey/chocolatey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
<Compile Include="infrastructure.app\commands\ChocolateyUpgradeCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyVersionCommand.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\FeatureCommandType.cs" />
<Compile Include="infrastructure.app\domain\PinCommandType.cs" />
<Compile Include="infrastructure.app\domain\SourceCommandType.cs" />
Expand Down
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 8d69788

Please sign in to comment.