-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit moving from CodePlex; change license
- Loading branch information
Showing
19 changed files
with
2,923 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,3 +286,6 @@ __pycache__/ | |
*.btm.cs | ||
*.odx.cs | ||
*.xsd.cs | ||
|
||
# Environment Settings Manager | ||
Staging/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildExporter;PackageMain"> | ||
<PropertyGroup> | ||
<Version>1_6_1</Version> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Main Include=".\docs\EnvironmentSettingsManagerGuide.pdf" /> | ||
<Main Include=".\template\EnvironmentSettingsTemplate.xml" /> | ||
<Main Include=".\template\EnvironmentSettingsTemplate.xls" /> | ||
<Main Include="License.txt" /> | ||
<Main Include=".\src\Exporter\bin\release\EnvironmentSettingsExporter.exe" /> | ||
</ItemGroup> | ||
|
||
<Target Name="BuildExporter"> | ||
<MSBuild Projects="src\EnvironmentSettingsExporter.sln" Properties="Configuration=Release" Targets="Rebuild" /> | ||
</Target> | ||
|
||
<Target Name="PackageMain"> | ||
<Delete Files="Staging\EnvironmentSettingsManagerV$(Version).zip" /> | ||
<Exec Command="tools\7za a -r -tzip Staging\EnvironmentSettingsManagerV$(Version).zip @(Main)" Condition="%(Identity) == %(Identity)" /> | ||
</Target> | ||
</Project> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvironmentSettingsExporter", "Exporter\EnvironmentSettingsExporter.csproj", "{85638D48-F3E0-4F88-BBDF-3884687770EE}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{85638D48-F3E0-4F88-BBDF-3884687770EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{85638D48-F3E0-4F88-BBDF-3884687770EE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{85638D48-F3E0-4F88-BBDF-3884687770EE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{85638D48-F3E0-4F88-BBDF-3884687770EE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// (c) Copyright 2007-10 Thomas F. Abraham. | ||
// This source is subject to the Microsoft Public License (Ms-PL). | ||
// See http://www.opensource.org/licenses/ms-pl.html | ||
// All other rights reserved. | ||
|
||
using System.Xml; | ||
|
||
namespace EnvironmentSettingsExporter | ||
{ | ||
/// <summary> | ||
/// Export the settings contained in a DataTable to multiple XML files, one per declared environment. | ||
/// The output XML format is the .NET appSettings structure. | ||
/// </summary> | ||
internal class DataTableToAppSettingsXmlExporter : DataTableToXmlExporter | ||
{ | ||
protected override void WriteHeader(XmlWriter xmlw, string environmentName) | ||
{ | ||
xmlw.WriteStartElement("appSettings"); | ||
} | ||
|
||
protected override void WriteValue(XmlWriter xmlw, string settingName, string settingValue, string environmentName, bool valueContainsReservedXmlCharacter) | ||
{ | ||
xmlw.WriteStartElement("add"); | ||
xmlw.WriteAttributeString("key", settingName); | ||
|
||
// Write the value to the XML stream | ||
xmlw.WriteAttributeString("value", settingValue); | ||
|
||
xmlw.WriteEndElement(); | ||
} | ||
|
||
protected override void WriteFooter(XmlWriter xmlw, string environmentName) | ||
{ | ||
xmlw.WriteEndElement(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// (c) Copyright 2007-10 Thomas F. Abraham. | ||
// This source is subject to the Microsoft Public License (Ms-PL). | ||
// See http://www.opensource.org/licenses/ms-pl.html | ||
// All other rights reserved. | ||
|
||
using System.Xml; | ||
|
||
namespace EnvironmentSettingsExporter | ||
{ | ||
/// <summary> | ||
/// Export the settings contained in a DataTable to a single XML file. | ||
/// The output format is a WiX (Windows Installer XML) include file containing a custom table. | ||
/// </summary> | ||
internal class DataTableToWixCustomTableXmlExporter : DataTableToXmlExporter | ||
{ | ||
private int index = 1; | ||
|
||
protected override void WriteHeader(XmlWriter xmlw, string environmentName) | ||
{ | ||
xmlw.WriteStartElement("include"); | ||
|
||
xmlw.WriteStartElement("CustomTable"); | ||
xmlw.WriteAttributeString("Id", "EnvironmentSettings"); | ||
|
||
xmlw.WriteStartElement("Column"); | ||
xmlw.WriteAttributeString("Id", "Id"); | ||
xmlw.WriteAttributeString("Category", "Identifier"); | ||
xmlw.WriteAttributeString("PrimaryKey", "yes"); | ||
xmlw.WriteAttributeString("Type", "int"); | ||
xmlw.WriteAttributeString("Width", "4"); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Column"); | ||
xmlw.WriteAttributeString("Id", "Environment"); | ||
xmlw.WriteAttributeString("Category", "Text"); | ||
xmlw.WriteAttributeString("Type", "string"); | ||
xmlw.WriteAttributeString("PrimaryKey", "no"); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Column"); | ||
xmlw.WriteAttributeString("Id", "Key"); | ||
xmlw.WriteAttributeString("Category", "Text"); | ||
xmlw.WriteAttributeString("Type", "string"); | ||
xmlw.WriteAttributeString("PrimaryKey", "no"); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Column"); | ||
xmlw.WriteAttributeString("Id", "Value"); | ||
xmlw.WriteAttributeString("Category", "Text"); | ||
xmlw.WriteAttributeString("Type", "string"); | ||
xmlw.WriteAttributeString("PrimaryKey", "no"); | ||
xmlw.WriteAttributeString("Nullable", "yes"); | ||
xmlw.WriteEndElement(); | ||
} | ||
|
||
protected override void WriteValue(XmlWriter xmlw, string settingName, string settingValue, string environmentName, bool valueContainsReservedXmlCharacter) | ||
{ | ||
xmlw.WriteStartElement("Row"); | ||
|
||
xmlw.WriteStartElement("Data"); | ||
xmlw.WriteAttributeString("Column", "Id"); | ||
xmlw.WriteValue(index); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Data"); | ||
xmlw.WriteAttributeString("Column", "Environment"); | ||
xmlw.WriteValue(environmentName); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Data"); | ||
xmlw.WriteAttributeString("Column", "Key"); | ||
xmlw.WriteValue(settingName); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteStartElement("Data"); | ||
xmlw.WriteAttributeString("Column", "Value"); | ||
xmlw.WriteValue(settingValue); | ||
xmlw.WriteEndElement(); | ||
|
||
xmlw.WriteEndElement(); | ||
|
||
index++; | ||
} | ||
|
||
protected override void WriteFooter(XmlWriter xmlw, string environmentName) | ||
{ | ||
xmlw.WriteEndElement(); | ||
xmlw.WriteEndElement(); | ||
} | ||
} | ||
} |
Oops, something went wrong.