Skip to content

Commit

Permalink
Feat: Converted to NET Standard 1.1 and NUnit 3
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswurtz committed Jan 21, 2019
1 parent caf14df commit c73f646
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 642 deletions.
147 changes: 26 additions & 121 deletions CPI.DirectoryServices/CPI.DirectoryServices.csproj
Original file line number Diff line number Diff line change
@@ -1,125 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>7.10.3077</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A7586740-2503-41AD-ABA8-EB523BE17153}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon />
<AssemblyKeyContainerName />
<AssemblyName>CPI.DirectoryServices</AssemblyName>
<AssemblyOriginatorKeyFile>Properties\DNParser.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>CPI.DirectoryServices</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject />
<FileUpgradeFlags>
</FileUpgradeFlags>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>0.0</OldToolsVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFramework>netstandard1.1</TargetFramework>
<Title>DNParser.Standard</Title>
<Description>An RFC 2253 Compliant Distinguished Name Parser. Written by Pete Everett, ported to Github and NuGet by Pascal Craponne and converted to .NET Standard by Thomas Würtz - CPOL License http://www.codeproject.com/info/cpol10.aspx</Description>
<Authors>Pete Everett, Pascal Craponne, Thomas Würtz</Authors>
<Copyright>Written by Pete Everett (ported to Github and NuGet by Pascal Craponne and Thomas Würtz) - CPOL License http://www.codeproject.com/info/cpol10.aspx</Copyright>
<Version>1.3</Version>
<PackageId>DNParser.Standard</PackageId>
<PackageVersion>1.3.0</PackageVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>-</PackageReleaseNotes>
<PackageLicenseUrl>http://www.codeproject.com/info/cpol10.aspx</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/picrap/DNParser</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/picrap/DNParser/master/Icon/DNParser.png</PackageIconUrl>
<PackageTags>rfc2253 dn rdn parser x500 relative distinguished name</PackageTags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile />
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\CPI.DirectoryServices.XML</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn />
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.1\CPI.DirectoryServices.XML</DocumentationFile>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile />
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\Release\CPI.DirectoryServices.XML</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn />
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.1\CPI.DirectoryServices.XML</DocumentationFile>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="EscapeChars.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DN.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RDN.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RDNComponent.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RDNValueType.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="DNParser.nuspec" />
<None Include="Properties\DNParser.snk" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent />
<PostBuildEvent />
</PropertyGroup>
</Project>

</Project>
5 changes: 4 additions & 1 deletion CPI.DirectoryServices/DN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* (C) 2005 Pete Everett (http://www.CynicalPirate.com)
*
*******************************************************************************/
/******************************************************************************
* Modified by: Thomas Würtz to support .NET Standard 2019-01-21
******************************************************************************/

using System;
using System.Collections;
Expand Down Expand Up @@ -219,7 +222,7 @@ private void ParseDN(string dnString)
// Break the DN down into its component RDNs.
// Don't check the validity of the RDNs; just find the separators.

ArrayList rawRDNs = new ArrayList();
List<string> rawRDNs = new List<string>();
ParserState state = ParserState.LookingForSeparator;
StringBuilder rawRDN = new StringBuilder();

Expand Down
23 changes: 0 additions & 23 deletions CPI.DirectoryServices/DNParser.nuspec

This file was deleted.

13 changes: 0 additions & 13 deletions CPI.DirectoryServices/Properties/AssemblyInfo.cs

This file was deleted.

26 changes: 14 additions & 12 deletions CPI.DirectoryServices/RDN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* (C) 2005 Pete Everett (http://www.CynicalPirate.com)
*
*******************************************************************************/

/******************************************************************************
* Modified by: Thomas Würtz to support .NET Standard 2019-01-21
******************************************************************************/

using System;
using System.Collections;
Expand Down Expand Up @@ -170,9 +172,9 @@ private void WriteUTF8Bytes(Stream s, char c)

private void ParseRDN(string rdnString)
{
ArrayList rawTypes = new ArrayList();
ArrayList rawValues = new ArrayList();
ArrayList rawValueTypes = new ArrayList();
List<string> rawTypes = new List<string>();
List<string> rawValues = new List<string>();
List<RDNValueType> rawValueTypes = new List<RDNValueType>();

MemoryStream rawData = new MemoryStream();

Expand Down Expand Up @@ -302,7 +304,7 @@ private void ParseRDN(string rdnString)
if (rdnString[position] == '=')
{
position++;
rawTypes.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawTypes.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);

if (position >= rdnString.Length)
Expand Down Expand Up @@ -381,7 +383,7 @@ private void ParseRDN(string rdnString)
{
position++;

string oid = Encoding.UTF8.GetString(rawData.ToArray());
string oid = Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length);

# region OIDs aren't allowed to end with a period

Expand Down Expand Up @@ -531,7 +533,7 @@ private void ParseRDN(string rdnString)
{
// If we're at the end of the string, just store what we've found and
// we'll exit the loop gracefully.
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
rawValueTypes.Add(RDNValueType.HexValue);
}
Expand All @@ -541,7 +543,7 @@ private void ParseRDN(string rdnString)
// pair after it. We'll store what we've found, advance to the next character,
// and set the state to DetermineAttributeType.
position++;
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
state = ParserState.DetermineAttributeType;
rawValueTypes.Add(RDNValueType.HexValue);
Expand Down Expand Up @@ -638,7 +640,7 @@ private void ParseRDN(string rdnString)
{
// If we're at the end of the string, just store what we've found and
// we'll exit the loop gracefully.
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
rawValueTypes.Add(RDNValueType.StringValue);
}
Expand All @@ -647,7 +649,7 @@ private void ParseRDN(string rdnString)
// if we've found a plus sign, that means that there's another name/value
// pair after it. We'll store what we've found, advance to the next character,
// and set the state to DetermineAttributeType.
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
state = ParserState.DetermineAttributeType;
rawValueTypes.Add(RDNValueType.StringValue);
Expand Down Expand Up @@ -759,7 +761,7 @@ private void ParseRDN(string rdnString)
// pair after it. We'll store what we've found, advance to the next character,
// and set the state to DetermineAttributeType.
position++;
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
state = ParserState.DetermineAttributeType;
rawValueTypes.Add(RDNValueType.StringValue);
Expand All @@ -771,7 +773,7 @@ private void ParseRDN(string rdnString)
}
else
{
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray()));
rawValues.Add(Encoding.UTF8.GetString(rawData.ToArray(), 0, (int)rawData.Length));
rawData.SetLength(0);
rawValueTypes.Add(RDNValueType.StringValue);
}
Expand Down
58 changes: 0 additions & 58 deletions NUnitTests/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit c73f646

Please sign in to comment.