├── Util ├── NuGet.exe └── ..svnbridge │ └── NuGet.exe ├── Source ├── Requirements.txt ├── Nito.KitchenSink.SimpleParsers │ ├── NET40 │ │ ├── packages.config │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── NET40.nuspec │ │ ├── DefaultSimpleParser.cs │ │ └── SimpleParser.cs │ ├── packages │ │ ├── repositories.config │ │ └── Nito.KitchenSink.Dynamic.1.0.0 │ │ │ ├── lib │ │ │ └── 4 │ │ │ │ ├── Nito.KitchenSink.Dynamic.dll │ │ │ │ ├── Nito.KitchenSink.Dynamic.pdb │ │ │ │ ├── CodeContracts │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.dll │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.pdb │ │ │ │ └── ..svnbridge │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.dll │ │ │ │ │ └── Nito.KitchenSink.Dynamic.Contracts.pdb │ │ │ │ └── ..svnbridge │ │ │ │ ├── Nito.KitchenSink.Dynamic.dll │ │ │ │ └── Nito.KitchenSink.Dynamic.pdb │ │ │ ├── Nito.KitchenSink.Dynamic.1.0.0.nupkg │ │ │ └── ..svnbridge │ │ │ └── Nito.KitchenSink.Dynamic.1.0.0.nupkg │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ ├── Nito.KitchenSink.SimpleParsers.sln │ └── SimpleParserAttribute.cs ├── Nito.KitchenSink.FileSystemPath │ ├── NET35 │ │ ├── packages.config │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── NET40 │ │ ├── packages.config │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── packages │ │ ├── Nito.KitchenSink.PInvokeInterop.1.0.0 │ │ │ ├── lib │ │ │ │ └── 2 │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.dll │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.pdb │ │ │ │ │ ├── CodeContracts │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.Contracts.dll │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.Contracts.pdb │ │ │ │ │ └── ..svnbridge │ │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.Contracts.dll │ │ │ │ │ │ └── Nito.KitchenSink.PInvokeInterop.Contracts.pdb │ │ │ │ │ └── ..svnbridge │ │ │ │ │ ├── Nito.KitchenSink.PInvokeInterop.dll │ │ │ │ │ └── Nito.KitchenSink.PInvokeInterop.pdb │ │ │ ├── Nito.KitchenSink.PInvokeInterop.1.0.0.nupkg │ │ │ └── ..svnbridge │ │ │ │ └── Nito.KitchenSink.PInvokeInterop.1.0.0.nupkg │ │ └── repositories.config │ ├── Tests │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── TraceAndTestImpact.testsettings │ ├── Local.testsettings │ ├── Nito.KitchenSink.FileSystemPaths.vsmdi │ ├── SharedAssemblyInfo.cs │ ├── ..svnbridge │ │ └── .svnbridge │ └── Nito.KitchenSink.FileSystemPaths.nuspec ├── Nito.KitchenSink.OptionParsing │ ├── packages │ │ ├── repositories.config │ │ ├── Nito.KitchenSink.Dynamic.1.0.0 │ │ │ ├── lib │ │ │ │ └── 4 │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.dll │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.pdb │ │ │ │ │ ├── CodeContracts │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.dll │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.pdb │ │ │ │ │ └── ..svnbridge │ │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.Contracts.dll │ │ │ │ │ │ └── Nito.KitchenSink.Dynamic.Contracts.pdb │ │ │ │ │ └── ..svnbridge │ │ │ │ │ ├── Nito.KitchenSink.Dynamic.dll │ │ │ │ │ └── Nito.KitchenSink.Dynamic.pdb │ │ │ ├── Nito.KitchenSink.Dynamic.1.0.0.nupkg │ │ │ └── ..svnbridge │ │ │ │ └── Nito.KitchenSink.Dynamic.1.0.0.nupkg │ │ └── Nito.KitchenSink.SimpleParsers.1.0.0 │ │ │ ├── lib │ │ │ └── 4 │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.dll │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.pdb │ │ │ │ ├── CodeContracts │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.Contracts.dll │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.Contracts.pdb │ │ │ │ └── ..svnbridge │ │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.Contracts.dll │ │ │ │ │ └── Nito.KitchenSink.SimpleParsers.Contracts.pdb │ │ │ │ └── ..svnbridge │ │ │ │ ├── Nito.KitchenSink.SimpleParsers.dll │ │ │ │ └── Nito.KitchenSink.SimpleParsers.pdb │ │ │ ├── Nito.KitchenSink.SimpleParsers.1.0.0.nupkg │ │ │ └── ..svnbridge │ │ │ └── Nito.KitchenSink.SimpleParsers.1.0.0.nupkg │ ├── NET40 │ │ ├── packages.config │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Option.cs │ │ ├── NET40.nuspec │ │ └── OptionPresentAttribute.cs │ ├── UnitTests │ │ ├── Properties │ │ │ ├── ..svnbridge │ │ │ │ └── .svnbridge │ │ │ └── AssemblyInfo.cs │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ └── CommandPromptCommandLineUnitTests.cs │ ├── TraceAndTestImpact.testsettings │ ├── Local.testsettings │ ├── Nito.KitchenSink.OptionParsing.vsmdi │ ├── PositionalArgumentsAttribute.cs │ ├── SharedAssemblyInfo.cs │ ├── ..svnbridge │ │ └── .svnbridge │ ├── PositionalArgumentAttribute.cs │ ├── OptionArgumentsBase.cs │ ├── CommandPromptCommandLine.cs │ ├── OptionDefinition.cs │ └── Nito.KitchenSink.OptionParsing.sln ├── Nito.KitchenSink.NotifyPropertyChanged │ ├── packages │ │ ├── repositories.config │ │ └── Nito.KitchenSink.GetPropertyName.1.0.0 │ │ │ ├── lib │ │ │ └── 35 │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.dll │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.pdb │ │ │ │ ├── CodeContracts │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.Contracts.dll │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.Contracts.pdb │ │ │ │ └── ..svnbridge │ │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.Contracts.dll │ │ │ │ │ └── Nito.KitchenSink.GetPropertyName.Contracts.pdb │ │ │ │ ├── ..svnbridge │ │ │ │ ├── Nito.KitchenSink.GetPropertyName.dll │ │ │ │ └── Nito.KitchenSink.GetPropertyName.pdb │ │ │ │ └── Nito.KitchenSink.GetPropertyName.xml │ │ │ ├── Nito.KitchenSink.GetPropertyName.1.0.0.nupkg │ │ │ └── ..svnbridge │ │ │ └── Nito.KitchenSink.GetPropertyName.1.0.0.nupkg │ ├── NET35 │ │ ├── packages.config │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET35.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ ├── Nito.KitchenSink.NotifyPropertyChanged.sln │ ├── NotifyPropertyChangedBase.cs │ └── INotifyPropertyChangedExtensions.cs ├── Source-index PDBs.cmd ├── Tests │ ├── ..svnbridge │ │ └── .svnbridge │ └── Unit Tests │ │ ├── StringsUnitTests.cs │ │ ├── GetPropertyNameUnitTests.cs │ │ ├── BooleanExtensionsUnitTests.cs │ │ ├── GuidExtensionsUnitTests.cs │ │ ├── LinkedListExtensionsUnitTests.cs │ │ ├── CRC16UnitTests.cs │ │ └── StreamExtensionsUnitTests.cs ├── GuidCracker │ ├── ..svnbridge │ │ └── .svnbridge │ └── Properties │ │ └── AssemblyInfo.cs ├── Nito.KitchenSink │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── SharedAssemblyInfo.cs │ ├── CharacterStreams │ │ ├── Token.cs │ │ ├── StringToken.cs │ │ └── DelimitedText │ │ │ ├── Tokens.cs │ │ │ └── Extensions.cs │ ├── ..svnbridge │ │ └── .svnbridge │ ├── Options │ │ ├── PositionalArgumentsAttribute.cs │ │ ├── PositionalArgumentAttribute.cs │ │ ├── OptionDefinition.cs │ │ ├── OptionArgumentsBase.cs │ │ └── OptionParsingException.cs │ ├── CciSharp │ │ ├── DependencyPropertyAttribute.cs │ │ └── ReadOnlyAttribute.cs │ ├── Anonymous │ │ ├── AnonymousDisposable.cs │ │ ├── A.cs │ │ └── AnonymousComparer.cs │ ├── Interop │ │ └── WinInet │ │ │ ├── InternetException.cs │ │ │ ├── SafeNativeMethods.cs │ │ │ └── SafeInternetHandle.cs │ ├── ExtensibleObjects │ │ ├── ExtensibleObject.cs │ │ ├── ExtensionCollectionExtensions.cs │ │ ├── ExtensibleWrapper.cs │ │ └── Interfaces.cs │ ├── LinkedListExtensions.cs │ ├── Text │ │ └── SimpleParserAttribute.cs │ ├── FileSystemPath │ │ └── FileSystemPathExtensions.cs │ ├── ReferenceEqualityComparer.cs │ ├── EncodingExtensions.cs │ ├── BooleanExtensions.cs │ ├── Disposables │ │ ├── DisposableExtensions.cs │ │ └── SafeDisposable.cs │ ├── TextReaders │ │ └── PositionTrackingTextReader.cs │ ├── ObjectExtensions.cs │ ├── EnumerableExtensions.cs │ ├── INotifyPropertyChanged │ │ ├── INotifyPropertyChangedExtensions.cs │ │ └── NotifyPropertyChangedBase.cs │ ├── Communication │ │ └── IFramer.cs │ ├── Reflection │ │ └── TypeExtensions.cs │ ├── CommaSeparatedValueFormatter.cs │ ├── HashAlgorithmExtensions.cs │ └── Dynamic │ │ └── RefOutArg.cs ├── Nito.KitchenSink.CRC │ ├── NET40 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET40.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.CRC.sln ├── Nito.KitchenSink.Dynamic │ ├── NET40 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET40.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.Dynamic.sln ├── Nito.KitchenSink.BinaryData │ ├── NET40 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET40.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.BinaryData.sln ├── Nito.KitchenSink.Exceptions │ ├── NET40 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET40.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.Exceptions.sln ├── Nito.KitchenSink.GuidDecoding │ ├── NET35 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET35.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.GuidDecoding.sln ├── Nito.KitchenSink.GetPropertyName │ ├── NET35 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET35.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ ├── Nito.KitchenSink.GetPropertyName.sln │ └── ObjectExtensions.cs ├── Nito.KitchenSink.HashAlgorithms │ ├── NET35 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET35.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.HashAlgorithms.sln ├── Nito.KitchenSink.PInvokeInterop │ ├── NET20 │ │ ├── ..svnbridge │ │ │ └── .svnbridge │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── NET20.nuspec │ ├── ..svnbridge │ │ └── .svnbridge │ ├── SharedAssemblyInfo.cs │ └── Nito.KitchenSink.PInvokeInterop.sln ├── ..svnbridge │ └── .svnbridge ├── Create release.cmd └── Build NuGet Packages.cmd ├── Documentation ├── Future.txt └── Release.txt ├── _future └── Nito.KitchenSink.Web │ ├── ..svnbridge │ └── .svnbridge │ └── Properties │ └── AssemblyInfo.cs ├── ..svnbridge └── .svnbridge ├── Libraries └── Versions.txt └── README.md /Util/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Util/NuGet.exe -------------------------------------------------------------------------------- /Source/Requirements.txt: -------------------------------------------------------------------------------- 1 | Code Contracts, Standard Edition: 2 | . http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET35/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET40/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/NET35/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Documentation/Future.txt: -------------------------------------------------------------------------------- 1 | . Revive ProjectedCollection (and its tests) from the old Nito.MVVM branch once .NET 4 is released (moving INotifyCollectionChanged into System). 2 | . Possibly also consider NotifyPropertyChangedCore -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/Nito.KitchenSink.Dynamic.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/Nito.KitchenSink.Dynamic.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/Nito.KitchenSink.Dynamic.1.0.0.nupkg -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/Nito.KitchenSink.Dynamic.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/Nito.KitchenSink.Dynamic.1.0.0.nupkg -------------------------------------------------------------------------------- /Source/Source-index PDBs.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM This file requires Debugging Tools for Windows, Perl (e.g., ActivePerl), and svn.exe (e.g., CollabNet/Tigris) 3 | call "c:\Program Files\Debugging Tools for Windows (x86)\srcsrv\ssindex.cmd" /SYSTEM=SVN /SYMBOLS=Nito.KitchenSink\bin\Release /Debug 4 | pause -------------------------------------------------------------------------------- /Source/Tests/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/GuidCracker/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Nito.KitchenSink for .NET 4.0 Client (includes Rx)")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/Nito.KitchenSink.SimpleParsers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/Nito.KitchenSink.SimpleParsers.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/Nito.KitchenSink.SimpleParsers.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/Nito.KitchenSink.SimpleParsers.pdb -------------------------------------------------------------------------------- /_future/Nito.KitchenSink.Web/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("CRC Library for .NET Framework 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/Nito.KitchenSink.PInvokeInterop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/Nito.KitchenSink.PInvokeInterop.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/Nito.KitchenSink.PInvokeInterop.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/Nito.KitchenSink.PInvokeInterop.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/Nito.KitchenSink.SimpleParsers.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/Nito.KitchenSink.SimpleParsers.1.0.0.nupkg -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Nito.KitchenSink.Dynamic for .NET 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/Nito.KitchenSink.PInvokeInterop.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/Nito.KitchenSink.PInvokeInterop.1.0.0.nupkg -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/NET35/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET35/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET40/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/Tests/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/NET35/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/NET35/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/UnitTests/Properties/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | bugtraq:numbertrue -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/NET20/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/NET20/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("P/Invoke Interop Helper Library for .NET Framework 2.0")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Binary Data Helper Library for .NET Framework 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Exception helpers library for .NET Framework 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Nito.KitchenSink.FileSystemPath for .NET 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("GUID Decoding Library for .NET Framework 3.5 SP1 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/NET35/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/Nito.KitchenSink.GetPropertyName.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/Nito.KitchenSink.GetPropertyName.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/Nito.KitchenSink.GetPropertyName.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/Nito.KitchenSink.GetPropertyName.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Option parsing library for .NET Framework 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Nito.KitchenSink.SimpleParsers for .NET 4.0 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.Dynamic.Contracts.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Nito.KitchenSink.FileSystemPath for .NET 3.5 SP1 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("GetPropertyName support for .NET Framework 3.5 SP1 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/Nito.KitchenSink.GetPropertyName.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/Nito.KitchenSink.GetPropertyName.1.0.0.nupkg -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("Hash Algorithms Helper Library for .NET Framework 3.5 SP1 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/NET35/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System.Reflection; 6 | 7 | [assembly: AssemblyTitle("NotifyPropertyChanged helpers for .NET Framework 3.5 SP1 Client Profile")] 8 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.SimpleParsers.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.SimpleParsers.Contracts.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.SimpleParsers.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/Nito.KitchenSink.SimpleParsers.Contracts.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/Nito.KitchenSink.PInvokeInterop.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/Nito.KitchenSink.PInvokeInterop.Contracts.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/Nito.KitchenSink.PInvokeInterop.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/Nito.KitchenSink.PInvokeInterop.Contracts.pdb -------------------------------------------------------------------------------- /Util/..svnbridge/NuGet.exe: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore_ReSharper.Nito.KitchenSink.GuidDecoding 2 | *.user 3 | *.suo 4 | -------------------------------------------------------------------------------- /Documentation/Release.txt: -------------------------------------------------------------------------------- 1 | To create a new release of Nito.KitchenSink: 2 | 1) Set version number in SharedAssemblyInfo. 3 | 2) Build in Release mode. 4 | 3) Run all unit tests. 5 | 4) Checkin sources. 6 | 5) Run "Source-index PDBs.cmd" to source-index the PDBs. 7 | 6) Run "Create release.cmd" to merge all libraries and place output under Binaries. 8 | 7) Create new CodePlex release. -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/Nito.KitchenSink.GetPropertyName.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/Nito.KitchenSink.GetPropertyName.Contracts.dll -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/Nito.KitchenSink.GetPropertyName.Contracts.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenClearyArchive/Nito.KitchenSink/HEAD/Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/Nito.KitchenSink.GetPropertyName.Contracts.pdb -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/UnitTests/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | bugtraq:numbertruesvn:ignorebin 2 | obj 3 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.CRC 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignoreTestResults 2 | *.suo 3 | svn:ignoreTestResults 4 | *.suo 5 | _ReSharper.Nito.KitchenSink 6 | *.user 7 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.Dynamic 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.BinaryData 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.Exceptions 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.GetPropertyName 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.HashAlgorithms 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.PInvokeInterop 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.SimpleParsers 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.NotifyPropertyChanged 4 | *.user 5 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CharacterStreams/Token.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.CharacterStreams 6 | { 7 | using ExtensibleObjects; 8 | 9 | /// 10 | /// A token (output from a lexer). 11 | /// 12 | public abstract class Token : ExtensibleObject 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | TestResults 4 | svn:ignore*.suo 5 | Binaries 6 | TestResults 7 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/..svnbridge/Nito.KitchenSink.Dynamic.1.0.0.nupkg: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.Dynamic.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.Dynamic.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/..svnbridge/Nito.KitchenSink.Dynamic.1.0.0.nupkg: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.Dynamic.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.Dynamic.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.SimpleParsers.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/..svnbridge/Nito.KitchenSink.SimpleParsers.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/..svnbridge/Nito.KitchenSink.PInvokeInterop.1.0.0.nupkg: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/..svnbridge/Nito.KitchenSink.PInvokeInterop.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/..svnbridge/Nito.KitchenSink.PInvokeInterop.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/..svnbridge/Nito.KitchenSink.SimpleParsers.1.0.0.nupkg: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Libraries/Versions.txt: -------------------------------------------------------------------------------- 1 | DotNetZip - 1.9.1.5 (2010-02-25), built from source including xmldoc without signing. 2 | http://dotnetzip.codeplex.com/ 3 | Nito.Async - 1.4 (2009-09-22) 4 | http://nitoasync.codeplex.com/ 5 | Nito.Linq/40.Rx - 0.9 (2010-09-10) 6 | http://nitolinq.codeplex.com/ 7 | SiftStringSimilarity - Beta (2009-03-27) 8 | http://sift.codeplex.com/ 9 | - 1.0.2698.0 (2010-09-10) 10 | http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/..svnbridge/Nito.KitchenSink.GetPropertyName.1.0.0.nupkg: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/..svnbridge/Nito.KitchenSink.GetPropertyName.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/..svnbridge/Nito.KitchenSink.GetPropertyName.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.Dynamic.Contracts.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.Dynamic.Contracts.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.Dynamic.Contracts.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/packages/Nito.KitchenSink.Dynamic.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.Dynamic.Contracts.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/TraceAndTestImpact.testsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | These are test settings for Trace and Test Impact. 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/TraceAndTestImpact.testsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | These are test settings for Trace and Test Impact. 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.SimpleParsers.Contracts.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/packages/Nito.KitchenSink.SimpleParsers.1.0.0/lib/4/CodeContracts/..svnbridge/Nito.KitchenSink.SimpleParsers.Contracts.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/..svnbridge/Nito.KitchenSink.PInvokeInterop.Contracts.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/packages/Nito.KitchenSink.PInvokeInterop.1.0.0/lib/2/CodeContracts/..svnbridge/Nito.KitchenSink.PInvokeInterop.Contracts.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignorebin 2 | obj 3 | svn:ignorebin 4 | obj 5 | *.Cache 6 | svn:ignorebin 7 | obj 8 | *.Cache 9 | *.user 10 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/Local.testsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | These are default test settings for a local test run. 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/..svnbridge/Nito.KitchenSink.GetPropertyName.Contracts.dll: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/CodeContracts/..svnbridge/Nito.KitchenSink.GetPropertyName.Contracts.pdb: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:mime-typeapplication/octet-stream -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/Local.testsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | These are default test settings for a local test run. 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CharacterStreams/StringToken.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.CharacterStreams 7 | { 8 | /// 9 | /// A string token, representing some string data. 10 | /// 11 | public class StringToken : Token 12 | { 13 | /// 14 | /// The data for this token. 15 | /// 16 | public string Data { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/Nito.KitchenSink.OptionParsing.vsmdi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/Nito.KitchenSink.FileSystemPaths.vsmdi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Options/PositionalArgumentsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.Options 7 | { 8 | /// 9 | /// Specifies that the command-line sets this property to the remaining positional arguments. The property type must be a collection. 10 | /// 11 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 12 | public sealed class PositionalArgumentsAttribute : Attribute 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Properties/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Everything except... well, you know.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito Libraries")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2010 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("0.13.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/PositionalArgumentsAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | using System; 8 | 9 | /// 10 | /// Specifies that the command-line sets this property to the remaining positional arguments. The property type must be a collection. 11 | /// 12 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 13 | public sealed class PositionalArgumentsAttribute : Attribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A helper library for P/Invoke Interop.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A library containing methods to decode GUIDs.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A helper library for working with byte sequences and arrays.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A helper library for dynamically accessing static type members.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A helper library for working with strings that are file system paths.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.2.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A library containing OpenSSL-like extension methods for HashAlgorithm.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Helper methods for implementing and consuming INotifyPropertyChanged.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Option parsing, inspired by getopt but also allowing for Windows conventions.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.2.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Generic CRC-16 and CRC-32 implementations, along with definitions for algorithms in common use.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Provides \"simple\" parsers, which are objects essentially implementing TryParse methods.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.FileSystemPaths 4 | *.user 5 | svn:ignore*.suo 6 | _ReSharper.Nito.KitchenSink.FileSystemPaths 7 | *.user 8 | TestResults 9 | svn:ignore*.suo 10 | _ReSharper.Nito.KitchenSink.FileSystemPaths 11 | *.user 12 | TestResults 13 | ARMADILLO_CACHE 14 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("Exception helpers, including ReThrow (with the stack trace preserved), AggregateException unwrapping, and dumping to xml.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CciSharp/DependencyPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// When used with CciSharp, turns an auto-property into a property that supports DependencyProperty. This can only be applied to non-virtual instance properties. 11 | /// See http://ccisamples.codeplex.com/wikipage?title=CciSharp. 12 | /// 13 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 14 | public sealed class DependencyPropertyAttribute : Attribute 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | using System; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyDescription("A library containing an extension method GetPropertyName which allows retrieving the property name from a lambda expression.")] 10 | [assembly: AssemblyCompany("Nito Programs")] 11 | [assembly: AssemblyProduct("Nito.KitchenSink Library")] 12 | [assembly: AssemblyCopyright("Copyright © 2009-2011 Nito Programs")] 13 | [assembly: ComVisible(false)] 14 | [assembly: CLSCompliant(true)] 15 | 16 | [assembly: AssemblyVersion("1.1.0.0")] 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CciSharp/ReadOnlyAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// When used with CciSharp, makes an auto-property read-only. This can only be applied to non-virtual instance properties. The setter on the property must be private and only called from the constructor. 11 | /// See http://ccisamples.codeplex.com/wikipage?title=CciSharp. 12 | /// 13 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 14 | public sealed class ReadOnlyAttribute : Attribute 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/Create release.cmd: -------------------------------------------------------------------------------- 1 | mkdir ..\Binaries\40.Rx\CodeContracts 2 | "%ProgramFiles%\Microsoft\ILMerge\ILMerge.exe" /xmldocs /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client" /out:..\Binaries\40.Rx\Nito.KitchenSink.dll Nito.KitchenSink\bin\Release\Nito.KitchenSink.dll ..\Libraries\Nito.Linq\40.Rx\Nito.Linq.dll ..\Libraries\Nito.Async\Nito.Async.dll ..\Libraries\Nito.Async\Nito.Async.Sockets.dll ..\Libraries\DotNetZip\Ionic.Zip.Reduced.dll ..\Libraries\SiftStringSimilarity\SiftStringSimilarity.dll Nito.KitchenSink\bin\Release\System.CoreEx.dll Nito.KitchenSink\bin\Release\System.Interactive.dll Nito.KitchenSink\bin\Release\System.Reactive.dll 3 | copy /Y Nito.KitchenSink\bin\Release\CodeContracts\*.* ..\Binaries\40.Rx\CodeContracts 4 | pause -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.CRC 5 | 1.1.0 6 | Nito.KitchenSink CRC Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito crc crc16 crc32 crc-16 crc-32 .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.Dynamic 5 | 1.1.0 6 | Nito.KitchenSink Dynamic Helper Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito dynamic static .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.BinaryData 5 | 1.1.0 6 | Nito.KitchenSink Binary Data Helper Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito binary byte .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/NET35/NET35.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.GuidDecoding 5 | 1.1.0 6 | Nito.KitchenSink GUID Decoding Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito guid .net35 .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/..svnbridge/.svnbridge: -------------------------------------------------------------------------------- 1 | svn:ignore*.suo 2 | svn:ignore*.suo 3 | _ReSharper.Nito.KitchenSink.OptionParsing 4 | *.user 5 | svn:ignore*.suo 6 | _ReSharper.Nito.KitchenSink.OptionParsing 7 | *.user 8 | ARMADILLO_CACHE 9 | bugtraq:numbertruesvn:ignore*.suo 10 | _ReSharper.Nito.KitchenSink.OptionParsing 11 | *.user 12 | ARMADILLO_CACHE 13 | TestResults 14 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/NET35/NET35.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.GetPropertyName 5 | 1.1.0 6 | Nito.KitchenSink GetPropertyName Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito property name .net35 .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/StringsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink.Text; 7 | 8 | namespace Tests.Unit_Tests 9 | { 10 | [TestClass] 11 | public class StringsUnitTests 12 | { 13 | [TestMethod] 14 | public void DamerauLevenshteinKnownValues() 15 | { 16 | Assert.AreEqual(0, Strings.DamerauLevenshteinDistance("test", "test")); 17 | Assert.AreEqual(1, Strings.DamerauLevenshteinDistance("to", "ot")); 18 | Assert.AreEqual(1, Strings.DamerauLevenshteinDistance("ot", "ost")); 19 | Assert.AreEqual(3, Strings.DamerauLevenshteinDistance("to", "ost")); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.Exceptions 5 | 1.1.0 6 | Nito.KitchenSink Exception Helpers Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito exception aggregateexception throw rethrow xml .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/NET35/NET35.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.HashAlgorithms 5 | 1.1.0 6 | Nito.KitchenSink Hash Algorithms Helper Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito hashalgorithm hash openssl .net35 .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/NET20/NET20.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.PInvokeInterop 5 | 1.1.0 6 | Nito.KitchenSink P/Invoke Interop Helper Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito pinvoke interop .net20 .net30 .net35 .net40 16 | 17 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/Option.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | /// 8 | /// An option that was parsed by the . 9 | /// 10 | public sealed class Option 11 | { 12 | /// 13 | /// Gets or sets the option definition that matched this option. May be null if this is a positional argument. 14 | /// 15 | public OptionDefinition Definition { get; set; } 16 | 17 | /// 18 | /// Gets or sets the argument passed to this option. May be null if there is no argument. 19 | /// 20 | public string Argument { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.SimpleParsers 5 | 1.1.0 6 | Nito.KitchenSink Simple Parsers Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito parse string .net40 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/NET40.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.OptionParsing 5 | 1.2.0 6 | Nito.KitchenSink Option Parsing Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito option options parse parsing getopt .net40 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/NET35/NET35.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.NotifyPropertyChanged 5 | 1.1.0 6 | Nito.KitchenSink NotifyPropertyChanged Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | $description$ 10 | $description$ 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito inotifypropertychanged notifypropertychanged propertychanged .net40 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Anonymous/AnonymousDisposable.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | using System.Collections.Generic; 9 | 10 | /// 11 | /// An object that implements using a delegate. 12 | /// 13 | public sealed class AnonymousDisposable : IDisposable 14 | { 15 | /// 16 | /// Gets or sets the Dispose delegate, which implements . 17 | /// 18 | public Action Dispose { get; set; } 19 | 20 | /// 21 | /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 22 | /// 23 | void IDisposable.Dispose() 24 | { 25 | this.Dispose(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Options/PositionalArgumentAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.Options 7 | { 8 | /// 9 | /// Specifies that a command-line positional argument sets this property. 10 | /// 11 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 12 | public sealed class PositionalArgumentAttribute : Attribute 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The index of the positional argument. 18 | public PositionalArgumentAttribute(int index) 19 | { 20 | this.Index = index; 21 | } 22 | 23 | /// 24 | /// Gets or sets the index of the positional argument. 25 | /// 26 | public int Index { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nito.KitchenSink 2 | 3 | "Everything except... well, you know..." 4 | 5 | A miscellaneous collection of utility classes, many of which provide extension methods for existing framework types. 6 | 7 | ## NuGet Releases 8 | 9 | The more stable parts of the KitchenSink library have been split into separate NuGet packages, which allow for more code reuse without including the entire KitchenSink library (it's past the 1 MB mark and heading quickly towards 2 MB). 10 | 11 | Each NuGet package is fully documented (xmldoc) and instrumented with Code Contracts before release. In addition, the designs of the classes going into NuGet packages are reviewed before they enter that process. 12 | 13 | As a result, the NuGet packages have more stability than the general KitchenSink library. Each NuGet package has its own independent [semantic version](http://semver.org/) number. 14 | 15 | ## CodePlex Releases 16 | 17 | Due to the nature of extension methods, almost every release of this library is a potentially breaking change. Because of this, Nito.KitchenSink does not use a "major.minor" version numbering scheme; only a "major" version is used. 18 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CharacterStreams/DelimitedText/Tokens.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.CharacterStreams.DelimitedText 7 | { 8 | /// 9 | /// Token types read from delimited text data. 10 | /// 11 | public static class Tokens 12 | { 13 | /// 14 | /// Field data token, representing field data in the original file. Field data supports CSV-style quoting, which is unquoted during lexing. 15 | /// 16 | public sealed class FieldData : StringToken 17 | { 18 | } 19 | 20 | /// 21 | /// A field separator. 22 | /// 23 | public sealed class FieldSeparator : Token 24 | { 25 | } 26 | 27 | /// 28 | /// An end of record indicator: '\r\n', '\n', or '\r'. An end of record indicator will not appear at the end of the input. 29 | /// 30 | public sealed class EndOfRecord : Token 31 | { 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Interop/WinInet/InternetException.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.WinInet 6 | { 7 | using System; 8 | 9 | /// 10 | /// An error as reported by a remote server. 11 | /// 12 | public sealed class InternetException : Exception 13 | { 14 | /// 15 | /// Initializes a new instance of the class with the specified attributes. 16 | /// 17 | /// The error code, as reported by the remote server. 18 | /// The message, as reported by the remote server. 19 | public InternetException(int code, string message) 20 | : base("Internet error code " + code + ": " + message) 21 | { 22 | this.Code = code; 23 | } 24 | 25 | /// 26 | /// Gets the error code, as reported by the remote server. 27 | /// 28 | public int Code { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ExtensibleObjects/ExtensibleObject.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.ExtensibleObjects 6 | { 7 | /// 8 | /// A simple base class for extensible objects. 9 | /// 10 | public abstract class ExtensibleObject : IExtensibleObject 11 | { 12 | /// 13 | /// The collection of extensions. 14 | /// 15 | private readonly ExtensionCollection extensions; 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | protected ExtensibleObject() 21 | { 22 | this.extensions = new ExtensionCollection(this); 23 | } 24 | 25 | /// 26 | /// Gets the collection of extension objects aggregated by this extensible object. 27 | /// 28 | public IExtensionCollection Extensions 29 | { 30 | get 31 | { 32 | return this.extensions; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.CRC/Nito.KitchenSink.CRC.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {49606DD0-82E2-4DB7-AC3F-0EF9C30278AB}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Dynamic/Nito.KitchenSink.Dynamic.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{BAF9BE1A-7B26-4C69-915E-F578E7E6973D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {BAF9BE1A-7B26-4C69-915E-F578E7E6973D}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.BinaryData/Nito.KitchenSink.BinaryData.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{618ABD64-A788-4ACA-B1A9-83784FEB0DD4}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {618ABD64-A788-4ACA-B1A9-83784FEB0DD4}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.Exceptions/Nito.KitchenSink.Exceptions.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{8D17BC1C-3F49-410B-99B8-B59364863B15}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {8D17BC1C-3F49-410B-99B8-B59364863B15}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GuidDecoding/Nito.KitchenSink.GuidDecoding.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET35", "NET35\NET35.csproj", "{5ECEF916-6F8D-4941-86B7-935B64FA7086}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {5ECEF916-6F8D-4941-86B7-935B64FA7086}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/Nito.KitchenSink.SimpleParsers.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{1A01541E-C6C4-4E72-B922-A164B2606684}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {1A01541E-C6C4-4E72-B922-A164B2606684}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {1A01541E-C6C4-4E72-B922-A164B2606684}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {1A01541E-C6C4-4E72-B922-A164B2606684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {1A01541E-C6C4-4E72-B922-A164B2606684}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {1A01541E-C6C4-4E72-B922-A164B2606684}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {1A01541E-C6C4-4E72-B922-A164B2606684}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/Nito.KitchenSink.GetPropertyName.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET35", "NET35\NET35.csproj", "{175DD41B-B39A-4970-A402-8E530A881E54}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {175DD41B-B39A-4970-A402-8E530A881E54}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {175DD41B-B39A-4970-A402-8E530A881E54}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {175DD41B-B39A-4970-A402-8E530A881E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {175DD41B-B39A-4970-A402-8E530A881E54}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {175DD41B-B39A-4970-A402-8E530A881E54}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {175DD41B-B39A-4970-A402-8E530A881E54}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.HashAlgorithms/Nito.KitchenSink.HashAlgorithms.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET35", "NET35\NET35.csproj", "{94449166-9C6B-4AA9-BF16-C1350F3D2FD1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {94449166-9C6B-4AA9-BF16-C1350F3D2FD1}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/UnitTests/CommandPromptCommandLineUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink.OptionParsing; 7 | using System.Diagnostics; 8 | 9 | namespace UnitTests 10 | { 11 | [TestClass] 12 | public class CommandPromptCommandLineUnitTests 13 | { 14 | [TestMethod] 15 | public void BlogExampleA() 16 | { 17 | // http://nitoprograms.blogspot.com/2011/06/option-parsing-lexing.html 18 | Assert.AreEqual("^^ \"^\"", CommandPromptCommandLine.Escape("^ \"^\"")); 19 | } 20 | 21 | [TestMethod] 22 | public void BlogExampleB() 23 | { 24 | // http://nitoprograms.blogspot.com/2011/06/option-parsing-lexing.html 25 | Assert.AreEqual("\"\"", CommandPromptCommandLine.Escape("\"\"")); 26 | } 27 | 28 | [TestMethod] 29 | public void BlogExampleC() 30 | { 31 | // http://nitoprograms.blogspot.com/2011/06/option-parsing-lexing.html 32 | Assert.AreEqual("\"^\"^^\"", CommandPromptCommandLine.Escape("\"^\"^\"")); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.PInvokeInterop/Nito.KitchenSink.PInvokeInterop.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET20", "NET20\NET20.csproj", "{D47AA74C-5358-40D4-9278-0C4B474393B1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {D47AA74C-5358-40D4-9278-0C4B474393B1}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/Nito.KitchenSink.NotifyPropertyChanged.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET35", "NET35\NET35.csproj", "{56356842-14D9-46F5-8C8D-4255FE77063E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {56356842-14D9-46F5-8C8D-4255FE77063E}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 14 | {56356842-14D9-46F5-8C8D-4255FE77063E}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 15 | {56356842-14D9-46F5-8C8D-4255FE77063E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {56356842-14D9-46F5-8C8D-4255FE77063E}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {56356842-14D9-46F5-8C8D-4255FE77063E}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {56356842-14D9-46F5-8C8D-4255FE77063E}.Release|Any CPU.Build.0 = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/packages/Nito.KitchenSink.GetPropertyName.1.0.0/lib/35/Nito.KitchenSink.GetPropertyName.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.GetPropertyName 5 | 6 | 7 | 8 | 9 | Provides extension methods applicable to all objects. 10 | 11 | 12 | 13 | 14 | Retrieves the name of a property referenced by a lambda expression. 15 | 16 | The type of object containing the property. 17 | The type of the property. 18 | The object containing the property. 19 | A lambda expression selecting the property from the containing object. May not be null. 20 | The name of the property referenced by . 21 | expression != null 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/LinkedListExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System.Collections.Generic; 8 | 9 | /// 10 | /// Extension methods for . 11 | /// 12 | public static class LinkedListExtensions 13 | { 14 | /// 15 | /// The nodes in this linked list, as a sequence. The nodes enumerated by this sequence are safe to pass to without disturbing the sequence iteration. 16 | /// 17 | /// The type of elements contained in the linked list. 18 | /// The linked list. 19 | /// A sequence containing each node in this linked list. 20 | public static IEnumerable> Nodes(this LinkedList list) 21 | { 22 | LinkedListNode node = list.First; 23 | while (node != null) 24 | { 25 | LinkedListNode next = node.Next; 26 | yield return node; 27 | node = next; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Text/SimpleParserAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.Text 7 | { 8 | /// 9 | /// Specifies that a given parser should be used for this type or member. 10 | /// 11 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property)] 12 | public sealed class SimpleParserAttribute : Attribute 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// Type of the parser. 18 | public SimpleParserAttribute(Type parserType) 19 | { 20 | if (parserType.GetInterface("Nito.KitchenSink.Text.ISimpleParser") == null) 21 | { 22 | throw new InvalidOperationException("The type passed to SimpleParserAttribute must implement ISimpleParser."); 23 | } 24 | 25 | this.ParserType = parserType; 26 | } 27 | 28 | /// 29 | /// Gets or sets the type of the parser. 30 | /// 31 | /// The type of the parser. 32 | public Type ParserType { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/GetPropertyNameUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | 8 | namespace UnitTests 9 | { 10 | [TestClass] 11 | public class GetPropertyNameUnitTests 12 | { 13 | [TestMethod] 14 | public void GetPropertyName_ForValueProperty_ReturnsPropertyName() 15 | { 16 | TestObject test = new TestObject(); 17 | string propertyName = test.GetPropertyName(x => x.ValueProperty); 18 | Assert.AreEqual("ValueProperty", propertyName, "GetPropertyName should return property name for value properties"); 19 | } 20 | 21 | [TestMethod] 22 | public void GetPropertyName_ForReferenceProperty_ReturnsPropertyName() 23 | { 24 | TestObject test = new TestObject(); 25 | string propertyName = test.GetPropertyName(x => x.ObjectProperty); 26 | Assert.AreEqual("ObjectProperty", propertyName, "GetPropertyName should return property name for reference properties"); 27 | } 28 | 29 | private sealed class TestObject 30 | { 31 | public int ValueProperty { get; set; } 32 | public object ObjectProperty { get; set; } 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/PositionalArgumentAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | using System; 8 | using System.Diagnostics.Contracts; 9 | 10 | /// 11 | /// Specifies that a command-line positional argument sets this property. 12 | /// 13 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 14 | public sealed class PositionalArgumentAttribute : Attribute 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | /// The index of the positional argument. 20 | public PositionalArgumentAttribute(int index) 21 | { 22 | Contract.Requires(index >= 0); 23 | 24 | this.Index = index; 25 | } 26 | 27 | /// 28 | /// Gets or sets the index of the positional argument. 29 | /// 30 | public int Index { get; set; } 31 | 32 | [ContractInvariantMethod] 33 | private void ObjectInvariant() 34 | { 35 | Contract.Invariant(this.Index >= 0); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Interop/WinInet/SafeNativeMethods.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.WinInet 6 | { 7 | using System.Runtime.InteropServices; 8 | using System.Security; 9 | 10 | /// 11 | /// Native methods that are safe for any caller. 12 | /// 13 | [SuppressUnmanagedCodeSecurity] 14 | internal static partial class SafeNativeMethods 15 | { 16 | /// 17 | /// Converts a local FILETIME to a Utc FILETIME. 18 | /// 19 | /// The local FILETIME to convert. 20 | /// Utc FILETIME. 21 | public static long FtpLocalFileTimeToFileTime(long localFileTime) 22 | { 23 | long ret; 24 | if (!FtpLocalFileTimeToFileTime(ref localFileTime, out ret)) 25 | { 26 | throw Interop.GetLastWin32Exception(); 27 | } 28 | 29 | return ret; 30 | } 31 | 32 | [DllImport("Kernel32.dll", EntryPoint = "LocalFileTimeToFileTime", SetLastError = true)] 33 | [return: MarshalAs(UnmanagedType.Bool)] 34 | private static extern bool FtpLocalFileTimeToFileTime(ref long lpLocalFileTime, out long lpFileTime); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/FileSystemPath/FileSystemPathExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// Provides extensions to expose with other system types. 11 | /// 12 | public static class FileSystemPathExtensions 13 | { 14 | /// 15 | /// Treats a string as a file system path. 16 | /// 17 | /// The source path. 18 | /// The file system path. 19 | public static FileSystemPath AsFileSystemPath(this string source) 20 | { 21 | return source; 22 | } 23 | 24 | /// 25 | /// Treats a special folder as a file system path. The resulting path is empty if the special folder does not exist or is virtual. 26 | /// 27 | /// The special folder. 28 | /// The file system path of the special folder. 29 | public static FileSystemPath AsFileSystemPath(this Environment.SpecialFolder specialFolder) 30 | { 31 | return Environment.GetFolderPath(specialFolder); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ReferenceEqualityComparer.cs: -------------------------------------------------------------------------------- 1 | namespace Nito.KitchenSink 2 | { 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | 7 | /// 8 | /// An object comparer that always compares objects based on reference equality. 9 | /// 10 | /// The type of objects being compared. 11 | public sealed class ReferenceEqualityComparer : IEqualityComparer, IEqualityComparer where T : class 12 | { 13 | bool IEqualityComparer.Equals(T x, T y) 14 | { 15 | return object.ReferenceEquals(x, y); 16 | } 17 | 18 | int IEqualityComparer.GetHashCode(T obj) 19 | { 20 | if (obj == null) 21 | { 22 | throw new ArgumentNullException("obj", "Object cannot be null."); 23 | } 24 | 25 | return obj.GetHashCode(); 26 | } 27 | 28 | bool IEqualityComparer.Equals(object x, object y) 29 | { 30 | return object.ReferenceEquals(x, y); 31 | } 32 | 33 | int IEqualityComparer.GetHashCode(object obj) 34 | { 35 | if (obj == null) 36 | { 37 | throw new ArgumentNullException("obj", "Object cannot be null."); 38 | } 39 | 40 | return obj.GetHashCode(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/EncodingExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System.IO; 8 | using System.Text; 9 | 10 | /// 11 | /// Extension methods for the class. 12 | /// 13 | public static class EncodingExtensions 14 | { 15 | /// 16 | /// Decodes all bytes from a stream into a string. 17 | /// 18 | /// The character encoding to fall back to, if there are no byte order marks or if is false. 19 | /// The stream to be read. 20 | /// Whether to look for byte order marks at the current position of the stream. 21 | /// The data from the stream, interpreted as a string according to the specified encoding. 22 | public static string GetString(this Encoding encoding, Stream stream, bool detectEncodingFromByteOrderMarks) 23 | { 24 | using (StreamReader reader = new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks)) 25 | { 26 | return reader.ReadToEnd(); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Tests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("dc078540-ec8a-4c9f-9e44-f4e59b76292b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microline Technology Corporation")] 12 | [assembly: AssemblyProduct("UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microline Technology Corporation 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e0fb25dc-d805-4dbb-b426-f369c259f2a1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Source/Build NuGet Packages.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not exist ..\Binaries mkdir ..\Binaries 3 | if not exist ..\Binaries\NuGet mkdir ..\Binaries\NuGet 4 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.PInvokeInterop\NET20\NET20.csproj -o ..\Binaries\NuGet 5 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.GuidDecoding\NET35\NET35.csproj -o ..\Binaries\NuGet 6 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.HashAlgorithms\NET35\NET35.csproj -o ..\Binaries\NuGet 7 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.GetPropertyName\NET35\NET35.csproj -o ..\Binaries\NuGet 8 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.Dynamic\NET40\NET40.csproj -o ..\Binaries\NuGet 9 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.SimpleParsers\NET40\NET40.csproj -o ..\Binaries\NuGet 10 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.OptionParsing\NET40\NET40.csproj -o ..\Binaries\NuGet 11 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.CRC\NET40\NET40.csproj -o ..\Binaries\NuGet 12 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.BinaryData\NET40\NET40.csproj -o ..\Binaries\NuGet 13 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.Exceptions\NET40\NET40.csproj -o ..\Binaries\NuGet 14 | ..\Util\nuget.exe pack -sym Nito.KitchenSink.NotifyPropertyChanged\NET35\NET35.csproj -o ..\Binaries\NuGet 15 | ..\Util\nuget.exe pack Nito.KitchenSink.FileSystemPath\Nito.KitchenSink.FileSystemPaths.nuspec -o ..\Binaries\NuGet 16 | @echo Rename Nito.KitchenSink.FileSystemPaths.*.nupkg to Nito.KitchenSink.FileSystemPaths.*.symbols.nupkg 17 | pause 18 | ..\Util\nuget.exe pack Nito.KitchenSink.FileSystemPath\Nito.KitchenSink.FileSystemPaths.nuspec -o ..\Binaries\NuGet -Exclude **\*.pdb -Exclude **\*.cs 19 | pause -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Options/OptionDefinition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.Options 7 | { 8 | /// 9 | /// Whether an option may take an argument. 10 | /// 11 | public enum OptionArgument 12 | { 13 | /// 14 | /// The option never takes an argument. 15 | /// 16 | None, 17 | 18 | /// 19 | /// The option requires an argument. 20 | /// 21 | Required, 22 | 23 | /// 24 | /// The option takes an argument if present. The argument may not start with '-' or '/'. 25 | /// 26 | Optional, 27 | } 28 | 29 | /// 30 | /// The definition of an option that may be passed to a console program. 31 | /// 32 | public sealed class OptionDefinition 33 | { 34 | /// 35 | /// Gets or sets the long name of the option. The long name may not contain ':' or '=' characters. 36 | /// 37 | public string LongName { get; set; } 38 | 39 | /// 40 | /// Gets or sets the short name of the option, if any. The short name may not be ':' or '='. 41 | /// 42 | public char? ShortName { get; set; } 43 | 44 | /// 45 | /// Gets or sets a value indicating whether this option takes an argument. 46 | /// 47 | public OptionArgument Argument { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Source/GuidCracker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GuidCracker")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microline Technology Corporation")] 12 | [assembly: AssemblyProduct("GuidCracker")] 13 | [assembly: AssemblyCopyright("Copyright © Microline Technology Corporation 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("19ff96ed-1984-440f-a687-918687dd7832")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/BooleanExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// Provides useful extension methods for the type. 11 | /// 12 | public static class BooleanExtensions 13 | { 14 | /// 15 | /// Converts a boolean value to an integer value. Returns 0 if the boolean value is false, or 1 if the boolean value is true. 16 | /// 17 | /// The boolean value to convert. 18 | /// 0 if the boolean value is false, or 1 if the boolean value is true. 19 | public static int ToInt32(this bool value) 20 | { 21 | return value ? 1 : 0; 22 | } 23 | 24 | /// 25 | /// Converts a nullable boolean value to a nullable integer value. Returns 0 if the boolean value is false, or 1 if the boolean value is true, or null if there is no boolean value. 26 | /// 27 | /// The boolean value to convert. 28 | /// 0 if the boolean value is false, or 1 if the boolean value is true, or null if there is no boolean value. 29 | public static int? ToInt32(this bool? value) 30 | { 31 | if (value.HasValue) 32 | { 33 | return value.Value.ToInt32(); 34 | } 35 | 36 | return null; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ExtensibleObjects/ExtensionCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.ExtensibleObjects 7 | { 8 | /// 9 | /// Extension methods for extension collections. 10 | /// 11 | public static class ExtensionCollectionExtensions 12 | { 13 | /// 14 | /// Adds a sequence of extension objects to an extension collection. 15 | /// 16 | /// The extension collection to which to add the extensions. 17 | /// The sequence of extension objects to add to the extension collection. 18 | public static void AddRange(this IExtensionCollection @this, IEnumerable extensions) 19 | { 20 | foreach (var extension in extensions) 21 | { 22 | @this.Add(extension); 23 | } 24 | } 25 | 26 | /// 27 | /// Removes all extension objects from this collection and moves them to a new collection. 28 | /// 29 | /// The extension collection from which to remove the extensions. 30 | /// The extension collection to which to add the extensions. 31 | public static void MoveAllExtensionsTo(this IExtensionCollection from, IExtensionCollection to) 32 | { 33 | var list = from.ToList(); 34 | from.Clear(); 35 | to.AddRange(list); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ExtensibleObjects/ExtensibleWrapper.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.ExtensibleObjects 6 | { 7 | /// 8 | /// Combines an object with a collection of extensions. 9 | /// 10 | /// The type of object to wrap. 11 | public sealed class ExtensibleWrapper : IExtensibleObject 12 | { 13 | /// 14 | /// Initializes a new instance of the class with a default value for . 15 | /// 16 | public ExtensibleWrapper() 17 | { 18 | this.Extensions = new ExtensionCollection(this); 19 | } 20 | 21 | /// 22 | /// Initializes a new instance of the class with the specified value for . 23 | /// 24 | /// The object to wrap. 25 | public ExtensibleWrapper(T @object) 26 | : this() 27 | { 28 | this.Object = @object; 29 | } 30 | 31 | /// 32 | /// Gets or sets the object that is made extensible by this wrapper. 33 | /// 34 | public T Object { get; set; } 35 | 36 | /// 37 | /// Gets or the extensions applied to this object. 38 | /// 39 | public IExtensionCollection Extensions { get; private set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Anonymous/A.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// Provides static creation methods for anonymous types. 11 | /// 12 | public static class A 13 | { 14 | /// 15 | /// Creates and returns an using the specified delegate. 16 | /// 17 | /// The type of objects to compare. 18 | /// Compares two objects and returns a value less than 0 if its first argument is less than its second argument, 0 if its two arguments are equal, or greater than 0 if its first argument is greater than its second argument. 19 | /// An . 20 | public static AnonymousComparer Comparer(Func compare) 21 | { 22 | return new AnonymousComparer { Compare = compare }; 23 | } 24 | 25 | /// 26 | /// Creates and returns an using the specified delegate. 27 | /// 28 | /// The action to take when the disposable object is disposed. 29 | /// An . 30 | public static AnonymousDisposable Disposable(Action dispose) 31 | { 32 | return new AnonymousDisposable { Dispose = dispose }; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /_future/Nito.KitchenSink.Web/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Nito.KitchenSink.Web")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microline Technology Corporation")] 12 | [assembly: AssemblyProduct("Nito.KitchenSink.Web")] 13 | [assembly: AssemblyCopyright("Copyright © Microline Technology Corporation 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c68895d0-f0f7-49e7-a957-729b98e8d3f7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Disposables/DisposableExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// Provides extension methods for types. 11 | /// 12 | public static class DisposableExtensions 13 | { 14 | /// 15 | /// Wraps this disposable object in a reference-counted disposable wrapper. 16 | /// 17 | /// The type of the underlying disposable object. 18 | /// The underlying disposable object to wrap. 19 | /// A reference-counted disposable wrapper. 20 | public static ReferenceCountedDisposable ReferenceCounted(this T disposable) where T : IDisposable 21 | { 22 | return new ReferenceCountedDisposable(disposable); 23 | } 24 | 25 | /// 26 | /// Wraps this disposable object in a wrapper which swallows any exceptions thrown from . 27 | /// 28 | /// The type of the underlying disposable object. 29 | /// The underlying disposable object to wrap. 30 | /// A safe disposable wrapper. 31 | public static SafeDisposable IgnoreDisposeExceptions(this T disposable) where T : IDisposable 32 | { 33 | return new SafeDisposable(disposable); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Anonymous/AnonymousComparer.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | using System.Collections.Generic; 9 | 10 | /// 11 | /// An object that implements using a delegate. 12 | /// 13 | /// The type of items to compare. 14 | public sealed class AnonymousComparer : IComparer 15 | { 16 | /// 17 | /// Gets or sets the Compare delegate, which compares two objects and returns a value less than 0 if its first argument is less than its second argument, 0 if its two arguments are equal, or greater than 0 if its first argument is greater than its second argument. 18 | /// 19 | public Func Compare { get; set; } 20 | 21 | /// 22 | /// Compares two objects and returns a value less than 0 if is less than , 0 if is equal to , or greater than 0 if is greater than . 23 | /// 24 | /// The first object to compare. 25 | /// The second object to compare. 26 | /// A value less than 0 if is less than , 0 if is equal to , or greater than 0 if is greater than . 27 | int IComparer.Compare(T x, T y) 28 | { 29 | return this.Compare(x, y); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.FileSystemPath/Nito.KitchenSink.FileSystemPaths.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Nito.KitchenSink.FileSystemPaths 5 | 1.2.0 6 | Nito.KitchenSink File System Paths Helper Library 7 | Stephen Cleary 8 | Stephen Cleary 9 | A helper library for working with strings that are file system paths. 10 | A helper library for working with strings that are file system paths. 11 | en-US 12 | http://nitokitchensink.codeplex.com/license 13 | http://nitokitchensink.codeplex.com/ 14 | https://lh3.googleusercontent.com/-JnePz9du5w0/Td3cjrRLbVI/AAAAAAAAFDo/6ps9Cd-jI8s/s800/Nito.KitchenSink.png 15 | nito path file directory folder filesystem .net35 .net40 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/BooleanExtensionsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | 8 | namespace UnitTests 9 | { 10 | [TestClass] 11 | public class BooleanExtensionsUnitTests 12 | { 13 | [TestMethod] 14 | public void FalseBoolean_ConvertedToInt_Is0() 15 | { 16 | bool booleanValue = false; 17 | int intValue = booleanValue.ToInt32(); 18 | Assert.AreEqual(0, intValue, "False boolean values should convert to 0"); 19 | } 20 | 21 | [TestMethod] 22 | public void TrueBoolean_ConvertedToInt_Is1() 23 | { 24 | bool booleanValue = true; 25 | int intValue = booleanValue.ToInt32(); 26 | Assert.AreEqual(1, intValue, "True boolean values should convert to 1"); 27 | } 28 | 29 | [TestMethod] 30 | public void FalseNullableBoolean_ConvertedToInt_Is0() 31 | { 32 | bool? booleanValue = false; 33 | int? intValue = booleanValue.ToInt32(); 34 | Assert.AreEqual(0, intValue.Value, "False boolean values should convert to 0"); 35 | } 36 | 37 | [TestMethod] 38 | public void TrueNullableBoolean_ConvertedToInt_Is1() 39 | { 40 | bool? booleanValue = true; 41 | int? intValue = booleanValue.ToInt32(); 42 | Assert.AreEqual(1, intValue.Value, "True boolean values should convert to 1"); 43 | } 44 | 45 | [TestMethod] 46 | public void NullBoolean_ConvertedToInt_IsNull() 47 | { 48 | bool? booleanValue = null; 49 | int? intValue = booleanValue.ToInt32(); 50 | Assert.IsFalse(intValue.HasValue, "Null boolean values should convert to null"); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/DefaultSimpleParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Nito.KitchenSink.Dynamic; 6 | using System.Diagnostics.Contracts; 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace Nito.KitchenSink.SimpleParsers 10 | { 11 | /// 12 | /// Implements for any type that defines a TryParse method with the standard signature. 13 | /// 14 | /// The type of object that this simple parser can parse. 15 | public sealed class DefaultSimpleParser : ISimpleParser 16 | { 17 | /// 18 | /// Provides dynamic access to the static type members. 19 | /// 20 | private static readonly dynamic TType = DynamicStaticTypeMembers.Create(); 21 | 22 | /// 23 | /// A single, shared instance of this parser type. 24 | /// 25 | public static readonly DefaultSimpleParser Instance = new DefaultSimpleParser(); 26 | 27 | Type ISimpleParser.ResultType 28 | { 29 | get 30 | { 31 | Type ret = typeof(T); 32 | Contract.Assume(ret != typeof(string)); 33 | Contract.Assume(Nullable.GetUnderlyingType(ret) == null); 34 | return ret; 35 | } 36 | } 37 | 38 | [SuppressMessage("Microsoft.Contracts", "Nonnull-174-0")] 39 | [SuppressMessage("Microsoft.Contracts", "Nonnull-179-0")] 40 | object ISimpleParser.TryParse(string value) 41 | { 42 | var ret = RefOutArg.Create(); 43 | if (TType.TryParse(value, ret)) 44 | { 45 | return ret.ValueAsObject; 46 | } 47 | 48 | return null; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Interop/WinInet/SafeInternetHandle.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.WinInet 6 | { 7 | using System; 8 | using System.Runtime.InteropServices; 9 | 10 | /// 11 | /// Represents an unmanaged HINTERNET resource. 12 | /// 13 | public sealed class SafeInternetHandle : SafeHandle 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public SafeInternetHandle() 19 | : base(IntPtr.Zero, true) 20 | { 21 | } 22 | 23 | /// 24 | /// Gets a value indicating whether the handle value is invalid. 25 | /// 26 | /// true if the handle value is invalid; otherwise, false. 27 | public override bool IsInvalid 28 | { 29 | get { return this.handle == IntPtr.Zero; } 30 | } 31 | 32 | /// 33 | /// Returns a that represents this instance. 34 | /// 35 | /// A that represents this instance. 36 | public override string ToString() 37 | { 38 | return "0x" + this.handle.ToString("X" + IntPtr.Size * 2); 39 | } 40 | 41 | /// 42 | /// Executes the code required to free the handle. 43 | /// 44 | /// true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a releaseHandleFailed MDA Managed Debugging Assistant. 45 | protected override bool ReleaseHandle() 46 | { 47 | return UnsafeNativeMethods.InternetCloseHandle(this.handle); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/TextReaders/PositionTrackingTextReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace Nito.KitchenSink 8 | { 9 | /// 10 | /// A wrapper around a source , providing stream position. This class does not perform buffering. 11 | /// 12 | /// The type of being wrapped. 13 | public sealed class PositionTrackingTextReader : SourceTextReader where T : TextReader 14 | { 15 | /// 16 | /// Initializes a new instance of the class wrapping the specified . 17 | /// 18 | /// The source to wrap. 19 | public PositionTrackingTextReader(T source) 20 | : base(source) 21 | { 22 | } 23 | 24 | /// 25 | /// Gets the position in the stream (the number of characters that have been read). 26 | /// 27 | public long Position { get; private set; } 28 | 29 | /// 30 | /// Reads the next character from the input stream and advances the character position by one character. 31 | /// 32 | /// The next character from the input stream, or -1 if no more characters are available. 33 | /// The is closed. 34 | /// An I/O error occurs. 35 | public override int Read() 36 | { 37 | int ret = base.Read(); 38 | if (ret != -1) 39 | { 40 | ++this.Position; 41 | } 42 | 43 | return ret; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ExtensibleObjects/Interfaces.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.ExtensibleObjects 7 | { 8 | /// 9 | /// Enables an object to extend any other object through aggregation. 10 | /// 11 | public interface IExtension 12 | { 13 | /// 14 | /// Enables an extension object to find out when it has been aggregated. Called when the extension is added to the property. This method may not raise an exception. 15 | /// 16 | /// The extensible object that aggregates this extension. This object may implement . 17 | void Attach(object owner); 18 | 19 | /// 20 | /// Enables an object to find out when it is no longer aggregated. Called when an extension is removed from the property. This method may not raise an exception and may be called from any thread. 21 | /// 22 | /// The extensible object that no longer aggregates this extension. This object may implement . 23 | void Detach(object owner); 24 | } 25 | 26 | /// 27 | /// Enables an object to be extended through aggregation. 28 | /// 29 | public interface IExtensibleObject 30 | { 31 | /// 32 | /// Gets the collection of extension objects aggregated by this extensible object. Note that the collection may not be threadsafe. 33 | /// 34 | IExtensionCollection Extensions { get; } 35 | } 36 | 37 | /// 38 | /// A collection of extension objects, which are notified when they are added to or removed from this collection. 39 | /// 40 | public interface IExtensionCollection : ICollection 41 | { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CharacterStreams/DelimitedText/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.CharacterStreams.DelimitedText 7 | { 8 | /// 9 | /// Extension methods for working with delimited text. 10 | /// 11 | public static class Extensions 12 | { 13 | /// 14 | /// Lexes a sequence of characters, producing a sequence of tokens. 15 | /// 16 | /// The source stream of characters. 17 | /// The field separator to use. The default value is ,. 18 | /// An enumerable sequence of tokens. 19 | public static IEnumerable LexDelimitedText(this IEnumerable source, char fieldSeparator = ',') 20 | { 21 | return new EnumerableLexer(source, fieldSeparator); 22 | } 23 | 24 | /// 25 | /// Parses a sequence of tokens, producing a sequence of records. 26 | /// 27 | /// The source stream of tokens. 28 | /// An enumerable sequence of records. 29 | public static IEnumerable> ParseDelimitedText(this IEnumerable source) 30 | { 31 | return new EnumerableParser(source); 32 | } 33 | 34 | /// 35 | /// Lexes and parses a sequence of characters, producing a sequence of records. 36 | /// 37 | /// The source stream of characters. 38 | /// The field separator to use. The default value is ,. 39 | /// An enumerable sequence of records. 40 | public static IEnumerable> ParseDelimitedText(this IEnumerable source, char fieldSeparator = ',') 41 | { 42 | return new EnumerableParser(source, fieldSeparator); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | using System.Linq.Expressions; 9 | 10 | /// 11 | /// Provides extension methods applicable to all objects. 12 | /// 13 | public static class ObjectExtensions 14 | { 15 | /// 16 | /// Retrieves the name of a property referenced by a lambda expression. 17 | /// 18 | /// The type of object containing the property. 19 | /// The type of the property. 20 | /// The object containing the property. 21 | /// A lambda expression selecting the property from the containing object. 22 | /// The name of the property referenced by . 23 | public static string GetPropertyName(this TObject @this, Expression> expression) 24 | { 25 | // For more information on the technique used here, see these blog posts: 26 | // http://themechanicalbride.blogspot.com/2007/03/symbols-on-steroids-in-c.html 27 | // http://michaelsync.net/2009/04/09/silverlightwpf-implementing-propertychanged-with-expression-tree 28 | // http://joshsmithonwpf.wordpress.com/2009/07/11/one-way-to-avoid-messy-propertychanged-event-handling/ 29 | // Note that the following blog post: 30 | // http://www.ingebrigtsen.info/post/2008/12/11/INotifyPropertyChanged-revisited.aspx 31 | // uses a similar technique, but must also account for implicit casts to object by checking for UnaryExpression. 32 | // Our solution uses generics, so this additional test is not necessary. 33 | return ((MemberExpression)expression.Body).Member.Name; 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Options/OptionArgumentsBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Nito.KitchenSink.Options 4 | { 5 | /// 6 | /// An arguments class, which uses option attributes on its properties. 7 | /// 8 | public interface IOptionArguments 9 | { 10 | /// 11 | /// Validates the arguments by throwing errors as necessary. 12 | /// 13 | void Validate(); 14 | } 15 | 16 | /// 17 | /// A base class for arguments classes, which use option attributes on their properties. Note that arguments classes do not need to derive from . 18 | /// 19 | public abstract class OptionArgumentsBase : IOptionArguments 20 | { 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | protected OptionArgumentsBase() 25 | { 26 | this.AdditionalArguments = new List(); 27 | } 28 | 29 | /// 30 | /// Gets the list of additional positional arguments after those specified by . 31 | /// 32 | [PositionalArguments] 33 | public List AdditionalArguments { get; private set; } 34 | 35 | /// 36 | /// Validates the arguments by throwing errors as necessary. The implementation checks to ensure that is empty. Derived classes do not have to invoke the base method, if they wish to allow additional positional arguments. 37 | /// 38 | public virtual void Validate() 39 | { 40 | if (this.AdditionalArguments.Count != 0) 41 | { 42 | throw new OptionParsingException.UnknownOptionException("Unknown parameter " + this.AdditionalArguments[0]); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/NET40/SimpleParser.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.SimpleParsers 6 | { 7 | using System; 8 | using System.Diagnostics.Contracts; 9 | using System.Diagnostics.CodeAnalysis; 10 | 11 | /// 12 | /// A simple parser for a specific type. 13 | /// 14 | [ContractClass(typeof(SimpleParserContracts))] 15 | public interface ISimpleParser 16 | { 17 | /// 18 | /// The type of the result of the method. This cannot be the type or a nullable value type. 19 | /// 20 | Type ResultType { get; } 21 | 22 | /// 23 | /// Attempts to parse a string value into a value of type . 24 | /// 25 | /// The string value to parse. 26 | /// The resulting parsed value, or null if parsing was not possible. 27 | object TryParse(string value); 28 | } 29 | 30 | [ContractClassFor(typeof(ISimpleParser))] 31 | internal abstract class SimpleParserContracts : ISimpleParser 32 | { 33 | public Type ResultType 34 | { 35 | [SuppressMessage("Microsoft.Contracts", "CC1036", Justification = "Nullable.GetUnderlyingType is pure.")] 36 | get 37 | { 38 | Contract.Ensures(Contract.Result() != null); 39 | Contract.Ensures(Contract.Result() != typeof(string)); 40 | Contract.Ensures(Nullable.GetUnderlyingType(Contract.Result()) == null); 41 | return null; 42 | } 43 | } 44 | 45 | public object TryParse(string value) 46 | { 47 | Contract.Requires(value != null); 48 | Contract.Ensures(Contract.Result() == null || Contract.Result().GetType() == this.ResultType); 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Disposables/SafeDisposable.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | 9 | /// 10 | /// Provides a non-throwing implementation of for a wrapped disposable object. 11 | /// 12 | /// The type of object to wrap. 13 | public sealed class SafeDisposable : IDisposable where T : IDisposable 14 | { 15 | /// 16 | /// Initializes a new instance of the class, wrapping the specified disposable object. 17 | /// 18 | /// The disposable object to wrap. 19 | public SafeDisposable(T value) 20 | { 21 | this.Value = value; 22 | } 23 | 24 | /// 25 | /// Gets the underlying disposable object. 26 | /// 27 | public T Value { get; private set; } 28 | 29 | /// 30 | /// Disposes the underlying disposable object, swallowing all exceptions. 31 | /// 32 | void IDisposable.Dispose() 33 | { 34 | try 35 | { 36 | this.Value.Dispose(); 37 | } 38 | // ReSharper disable EmptyGeneralCatchClause 39 | catch 40 | // ReSharper restore EmptyGeneralCatchClause 41 | { 42 | // Normally, an empty catch block is a Really Bad Idea. 43 | // In this case, it's necessary to work around broken code from Microsoft (WCF client proxies, in particular). 44 | } 45 | } 46 | 47 | /// 48 | /// Returns a that represents this instance. 49 | /// 50 | /// A that represents this instance. 51 | public override string ToString() 52 | { 53 | return Convert.ToString(this.Value); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/OptionArgumentsBase.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | using System.Collections.Generic; 8 | using System.Diagnostics.Contracts; 9 | 10 | /// 11 | /// A base class for arguments classes, which use option attributes on their properties. Note that arguments classes do not need to derive from , but they do need to implement . 12 | /// 13 | public abstract class OptionArgumentsBase : IOptionArguments 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | protected OptionArgumentsBase() 19 | { 20 | this.AdditionalArguments = new List(); 21 | } 22 | 23 | /// 24 | /// Gets the list of additional positional arguments after those specified by . 25 | /// 26 | [PositionalArguments] 27 | public List AdditionalArguments { get; private set; } 28 | 29 | [ContractInvariantMethod] 30 | private void ObjectInvariant() 31 | { 32 | Contract.Invariant(this.AdditionalArguments != null); 33 | } 34 | 35 | /// 36 | /// Validates the arguments by throwing errors as necessary. The implementation checks to ensure that is empty. Derived classes do not have to invoke the base method, if they wish to allow additional positional arguments. 37 | /// 38 | public virtual void Validate() 39 | { 40 | if (this.AdditionalArguments.Count != 0) 41 | { 42 | throw new OptionParsingException.UnknownOptionException("Unknown parameter " + this.AdditionalArguments[0]); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/GuidExtensionsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | 8 | namespace UnitTests 9 | { 10 | [TestClass] 11 | public class GuidExtensionsUnitTests 12 | { 13 | [TestMethod] 14 | public void Test_KnownGUID_A() 15 | { 16 | // This GUID was generated on 2010-02-24 on my machine using "uuidgen -x" 17 | Guid test = new Guid("6478c9bd-2157-11df-8f70-001c234418a3"); 18 | Assert.AreEqual(GuidVariant.RFC4122, test.GetVariant()); 19 | Assert.AreEqual(GuidVersion.TimeBased, test.GetVersion()); 20 | Assert.IsTrue(test.NodeIsMAC()); 21 | Assert.IsTrue(test.GetNode().SequenceEqual(new byte[] { 0x00, 0x1C, 0x23, 0x44, 0x18, 0xA3 })); // This MAC address was retrieved using "ipconfig /all" 22 | Assert.IsTrue(test.GetCreateTime().Date == new DateTime(2010, 02, 24)); 23 | } 24 | 25 | [TestMethod] 26 | public void Test_KnownGUID_B() 27 | { 28 | // This GUID was generated on 2010-02-24 on my machine using "uuidgen -x" 29 | Guid test = new Guid("661a0750-2157-11df-8f70-001c234418a3"); 30 | Assert.AreEqual(GuidVariant.RFC4122, test.GetVariant()); 31 | Assert.AreEqual(GuidVersion.TimeBased, test.GetVersion()); 32 | Assert.IsTrue(test.NodeIsMAC()); 33 | Assert.IsTrue(test.GetNode().SequenceEqual(new byte[] { 0x00, 0x1C, 0x23, 0x44, 0x18, 0xA3 })); // This MAC address was retrieved using "ipconfig /all" 34 | Assert.IsTrue(test.GetCreateTime().Date == new DateTime(2010, 02, 24)); 35 | } 36 | 37 | [TestMethod] 38 | public void Test_KnownGUID_C() 39 | { 40 | // This GUID was generated on 2010-02-24 on my machine using "uuidgen" 41 | Guid test = new Guid("87ce17d1-7d63-42e5-aafb-4e105942fbf7"); 42 | Assert.AreEqual(GuidVariant.RFC4122, test.GetVariant()); 43 | Assert.AreEqual(GuidVersion.Random, test.GetVersion()); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/LinkedListExtensionsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | 8 | namespace UnitTests 9 | { 10 | [TestClass] 11 | public class LinkedListExtensionsUnitTests 12 | { 13 | [TestMethod] 14 | public void Nodes_EmptyList_ReturnsEmptySequence() 15 | { 16 | var list = new LinkedList(); 17 | var result = list.Nodes(); 18 | Assert.IsTrue(result.SequenceEqual(new LinkedListNode[] { }), "Nodes on an empty list should result in an empty sequence"); 19 | } 20 | 21 | [TestMethod] 22 | public void Nodes_SingleElementList_ReturnsSingleElementSequence() 23 | { 24 | var list = new LinkedList(); 25 | list.AddLast(13); 26 | var result = list.Nodes(); 27 | Assert.IsTrue(result.Select(x => x.Value).SequenceEqual(new[] { 13 }), "Nodes on a single-element list should result in a single-element sequence"); 28 | } 29 | 30 | [TestMethod] 31 | public void Nodes_TwoElementList_ReturnsTwoElementSequence() 32 | { 33 | var list = new LinkedList(); 34 | list.AddLast(13); 35 | list.AddLast(17); 36 | var result = list.Nodes(); 37 | Assert.IsTrue(result.Select(x => x.Value).SequenceEqual(new[] { 13, 17 }), "Nodes on a two-element list should result in a two-element sequence"); 38 | } 39 | 40 | [TestMethod] 41 | public void Nodes_AllowsRemoval() 42 | { 43 | var list = new LinkedList(); 44 | List result = new List(); 45 | list.AddLast(13); 46 | list.AddLast(17); 47 | foreach (var node in list.Nodes()) 48 | { 49 | if (node.Value == 13) 50 | list.Remove(node); 51 | } 52 | Assert.IsTrue(list.Nodes().Select(x => x.Value).SequenceEqual(new[] { 17 }), "Nodes should allow removal of the current element"); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink 7 | { 8 | /// 9 | /// Extension methods for . 10 | /// 11 | public static class EnumerableExtensions 12 | { 13 | /// 14 | /// Creates a wrapper for the returned from . 15 | /// 16 | /// The type of objects being enumerated. 17 | /// The source enumeration. 18 | /// An enumerator wrapper. 19 | public static EnumeratorWrapper CreateEnumeratorWrapper(this IEnumerable source) 20 | { 21 | return new EnumeratorWrapper(source); 22 | } 23 | 24 | /// 25 | /// Attempts to determine the count of an enumeration without enumerating it. Returns true if the count was successfully determined. 26 | /// 27 | /// The type of objects in the enumeration. 28 | /// The source enumeration. 29 | /// On return, contains the count of the enumeration if the return value was true. If the return value was false, this value is undefined. 30 | /// true if the count was successfully determined; otherwise, false. 31 | public static bool TryGetCount(this IEnumerable source, out int result) 32 | { 33 | var collection1 = source as ICollection; 34 | if (collection1 != null) 35 | { 36 | result = collection1.Count; 37 | return true; 38 | } 39 | 40 | var collection2 = source as System.Collections.ICollection; 41 | if (collection2 != null) 42 | { 43 | result = collection2.Count; 44 | return true; 45 | } 46 | 47 | result = -1; 48 | return false; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.GetPropertyName/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.GetPropertyName 6 | { 7 | using System; 8 | using System.Diagnostics.Contracts; 9 | using System.Linq.Expressions; 10 | 11 | /// 12 | /// Provides extension methods applicable to all objects. 13 | /// 14 | public static class ObjectExtensions 15 | { 16 | /// 17 | /// Retrieves the name of a property referenced by a lambda expression. 18 | /// 19 | /// The type of object containing the property. 20 | /// The type of the property. 21 | /// The object containing the property. 22 | /// A lambda expression selecting the property from the containing object. May not be null. 23 | /// The name of the property referenced by . 24 | public static string GetPropertyName(this TObject @this, Expression> expression) 25 | { 26 | Contract.Requires(expression != null); 27 | 28 | // For more information on the technique used here, see these blog posts: 29 | // http://themechanicalbride.blogspot.com/2007/03/symbols-on-steroids-in-c.html 30 | // http://michaelsync.net/2009/04/09/silverlightwpf-implementing-propertychanged-with-expression-tree 31 | // http://joshsmithonwpf.wordpress.com/2009/07/11/one-way-to-avoid-messy-propertychanged-event-handling/ 32 | // Note that the following blog post: 33 | // http://www.ingebrigtsen.info/post/2008/12/11/INotifyPropertyChanged-revisited.aspx 34 | // uses a similar technique, but must also account for implicit casts to object by checking for UnaryExpression. 35 | // Our solution uses generics, so this additional test is not necessary. 36 | return ((MemberExpression)expression.Body).Member.Name; 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/INotifyPropertyChanged/INotifyPropertyChangedExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | using System.ComponentModel; 9 | using System.Linq.Expressions; 10 | 11 | /// 12 | /// Provides extension methods for objects implementing . 13 | /// 14 | public static class INotifyPropertyChangedExtensions 15 | { 16 | /// 17 | /// Subscribes a handler to the event for a specific property. 18 | /// 19 | /// The type implementing . 20 | /// The type of the property. 21 | /// The object implementing . 22 | /// The lambda expression selecting the property. 23 | /// The handler that is invoked when the property changes. 24 | /// The actual delegate subscribed to . 25 | public static PropertyChangedEventHandler SubscribeToPropertyChanged( 26 | this TObject source, 27 | Expression> expression, 28 | Action handler) 29 | where TObject : INotifyPropertyChanged 30 | { 31 | // This is similar but not identical to: 32 | // http://www.ingebrigtsen.info/post/2008/12/11/INotifyPropertyChanged-revisited.aspx 33 | string propertyName = source.GetPropertyName(expression); 34 | PropertyChangedEventHandler ret = (s, e) => 35 | { 36 | if (e.PropertyName == propertyName) 37 | { 38 | handler(source); 39 | } 40 | }; 41 | source.PropertyChanged += ret; 42 | return ret; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Communication/IFramer.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.Communication 6 | { 7 | using System.Collections.Generic; 8 | 9 | /// 10 | /// Receives notification that a message has arrived. 11 | /// 12 | /// The message that has arrived. This may contain an alias of the data passed to in this call stack, but will not contain an alias to any data previously passed to . 13 | public delegate void MessageArrivedEventHandler(IList message); 14 | 15 | /// 16 | /// A message framer. Converts a stream of bytes into a stream of messages, represented as byte arrays. 17 | /// 18 | public interface IFramer 19 | { 20 | /// 21 | /// Occurs when a message has arrived. Exceptions thrown from this method propogate through , and may leave the framer instance in an invalid state. 22 | /// 23 | event MessageArrivedEventHandler MessageArrived; 24 | 25 | /// 26 | /// Notifies the framer instance that incoming data has been received from the stream. This method will invoke as necessary. 27 | /// 28 | /// 29 | /// This method may invoke zero or more times. 30 | /// Zero-length receives are ignored. May streams use a 0-length read to indicate the end of a stream, but the framer takes no action in this case. 31 | /// 32 | /// The data received from the stream. Cannot be null. May be a slice of the read buffer for the stream. 33 | /// If the data received is not a properly-formed message. 34 | void DataReceived(IList data); 35 | 36 | /// 37 | /// Re-initializes the framer instance to a clean state. After this method returns, the framer instance is identical to a newly-constructed instance. 38 | /// 39 | void Reset(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/CommandPromptCommandLine.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Nito Programs. 3 | // 4 | 5 | using System.Diagnostics.Contracts; 6 | using System.Text; 7 | 8 | namespace Nito.KitchenSink.OptionParsing 9 | { 10 | /// 11 | /// Provides command-prompt-compatible escaping for command lines. 12 | /// 13 | public static class CommandPromptCommandLine 14 | { 15 | /// 16 | /// Takes a command line to pass to a program, and escapes any unquoted characters that are special to the command prompt shell: & | ( ) < > ^ 17 | /// 18 | /// The command line to pass to the program. 19 | /// The command line to send to the command prompt shell. 20 | public static string Escape(string commandLine) 21 | { 22 | Contract.Requires(commandLine != null); 23 | Contract.Ensures(Contract.Result() != null); 24 | 25 | var ret = new StringBuilder(); 26 | bool inQuote = false; 27 | foreach (var ch in commandLine) 28 | { 29 | if (ch == '"') 30 | { 31 | // Quote characters begin or end a quoted context, and are always passed through. 32 | inQuote = !inQuote; 33 | ret.Append(ch); 34 | } 35 | else if (inQuote) 36 | { 37 | // If we're in a quoted context, no special characters need to be escaped. 38 | ret.Append(ch); 39 | } 40 | else if (ch == '&' || ch == '|' || ch == '(' || ch == ')' || ch == '<' || ch == '>' || ch == '^') 41 | { 42 | // Special characters outside a quoted context need to be escaped. 43 | ret.Append('^'); 44 | ret.Append(ch); 45 | } 46 | else 47 | { 48 | // Regular characters outside a quoted context do not need to be escaped. 49 | ret.Append(ch); 50 | } 51 | } 52 | 53 | return ret.ToString(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Reflection/TypeExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Nito.KitchenSink.Reflection 2 | { 3 | using System; 4 | using System.Linq; 5 | using System.Reflection; 6 | 7 | /// 8 | /// Extension methods for the type. 9 | /// 10 | public static class TypeExtensions 11 | { 12 | /// 13 | /// Returns true if this type uses reference equality (i.e., does not override ); returns false if this type or any of its base types override . This method returns false for any interface type, and returns true for any reference-equatable base class even if a derived class is not reference-equatable; the best way to determine if an object uses reference equality is to pass the exact type of that object. 14 | /// 15 | /// The type to test for reference equality. 16 | /// Returns true if this type uses reference equality (i.e., does not override ); returns false if this type or any of its base types override . 17 | public static bool IsReferenceEquatable(this Type type) 18 | { 19 | // Only reference types can use reference equality. 20 | if (!type.IsClass || type.IsPointer) 21 | { 22 | return false; 23 | } 24 | 25 | // Find all methods called "Equals" defined in the type's hierarchy (except object.Equals), and retrieve the base definitions. 26 | var equalsMethods = from method in type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy) 27 | where method.Name == "Equals" && method.DeclaringType != typeof(object) 28 | select method.GetBaseDefinition(); 29 | 30 | // Take those base definitions and check if any of them are object.Equals. If there are any, then we know that the type overrides 31 | // object.Equals or derives from a type that overrides object.Equals. 32 | var objectEqualsMethod = equalsMethods.Any(method => method.DeclaringType == typeof(object)); 33 | 34 | return !objectEqualsMethod; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/CRC16UnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | using System.Security.Cryptography; 8 | 9 | namespace Tests.Unit_Tests 10 | { 11 | [TestClass] 12 | public class CRC16UnitTests 13 | { 14 | [TestMethod] 15 | public void CRC16_Default_ChecksumVerification() 16 | { 17 | var calculator = new CRC16(); 18 | var test = Encoding.ASCII.GetBytes("123456789"); 19 | var result = calculator.ComputeHash(test, 0, test.Length); 20 | Assert.AreEqual(0xBB3D, BitConverter.ToUInt16(result, 0)); 21 | } 22 | 23 | [TestMethod] 24 | public void CRC16_CcittFalse_ChecksumVerification() 25 | { 26 | var calculator = new CRC16(CRC16.Definition.CcittFalse); 27 | var test = Encoding.ASCII.GetBytes("123456789"); 28 | var result = calculator.ComputeHash(test, 0, test.Length); 29 | Assert.AreEqual((ushort)0x29B1, BitConverter.ToUInt16(result, 0)); 30 | } 31 | 32 | [TestMethod] 33 | public void CRC16_Ccitt_ChecksumVerification() 34 | { 35 | var calculator = new CRC16(CRC16.Definition.Ccitt); 36 | var test = Encoding.ASCII.GetBytes("123456789"); 37 | var result = calculator.ComputeHash(test, 0, test.Length); 38 | Assert.AreEqual((ushort)0x2189, BitConverter.ToUInt16(result, 0)); 39 | } 40 | 41 | [TestMethod] 42 | public void CRC16_XModem_ChecksumVerification() 43 | { 44 | var calculator = new CRC16(CRC16.Definition.XModem); 45 | var test = Encoding.ASCII.GetBytes("123456789"); 46 | var result = calculator.ComputeHash(test, 0, test.Length); 47 | Assert.AreEqual((ushort)0x31C3, BitConverter.ToUInt16(result, 0)); 48 | } 49 | 50 | [TestMethod] 51 | public void CRC16_X25_ChecksumVerification() 52 | { 53 | var calculator = new CRC16(CRC16.Definition.X25); 54 | var test = Encoding.ASCII.GetBytes("123456789"); 55 | var result = calculator.ComputeHash(test, 0, test.Length); 56 | Assert.AreEqual((ushort)0x906E, BitConverter.ToUInt16(result, 0)); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/CommaSeparatedValueFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace Nito.KitchenSink 8 | { 9 | /// 10 | /// Provides RFC4180-compliant CSV formatting for a data stream. 11 | /// 12 | public sealed class CommaSeparatedValueFormatter 13 | { 14 | /// 15 | /// The stream of data to format as CSV. 16 | /// 17 | private readonly IEnumerable> data; 18 | 19 | /// 20 | /// The headers to write to the CSV, if any. 21 | /// 22 | private readonly IEnumerable headers; 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | /// The stream of data to format as CSV. 28 | /// The headers to write to the CSV, if any. This parameter may be null. 29 | public CommaSeparatedValueFormatter(IEnumerable> data, IEnumerable headers = null) 30 | { 31 | this.data = data; 32 | this.headers = headers; 33 | } 34 | 35 | /// 36 | /// Writes the data as a CSV stream to the specified writer. 37 | /// 38 | /// The writer to which to write the CSV stream. 39 | public void Write(TextWriter writer) 40 | { 41 | if (this.headers != null) 42 | { 43 | writer.WriteLine(string.Join(",", this.headers.Select(EscapeFieldValue))); 44 | } 45 | 46 | foreach (var record in this.data) 47 | { 48 | writer.WriteLine(string.Join(",", record.Select(EscapeFieldValue))); 49 | } 50 | } 51 | 52 | /// 53 | /// Escapes a field value. 54 | /// 55 | /// The field value to escape. 56 | /// The escaped field value. 57 | private static string EscapeFieldValue(string fieldValue) 58 | { 59 | return "\"" + fieldValue.Replace("\"", "\"\"") + "\""; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/OptionDefinition.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | /// 8 | /// Whether an option may take an argument. 9 | /// 10 | public enum OptionArgument 11 | { 12 | /// 13 | /// The option never takes an argument. 14 | /// 15 | None, 16 | 17 | /// 18 | /// The option requires an argument. 19 | /// 20 | Required, 21 | 22 | /// 23 | /// The option takes an argument if present. The argument may not start with '-' or '/'. 24 | /// 25 | Optional, 26 | } 27 | 28 | /// 29 | /// The definition of an option that may be passed to a console program. 30 | /// 31 | public sealed class OptionDefinition 32 | { 33 | /// 34 | /// Gets or sets the long name of the option. The long name may not contain ':' or '=' characters. 35 | /// 36 | public string LongName { get; set; } 37 | 38 | /// 39 | /// Gets or sets the short name of the option, if any. The short name may not be ':' or '='. 40 | /// 41 | public char? ShortName { get; set; } 42 | 43 | /// 44 | /// Gets the short name of the option as a string. 45 | /// 46 | public string ShortNameAsString 47 | { 48 | get 49 | { 50 | if (this.ShortName == null) 51 | { 52 | return null; 53 | } 54 | 55 | return this.ShortName.ToString(); 56 | } 57 | } 58 | 59 | /// 60 | /// Gets the long name, if any; otherwise, gets the short name, if any. 61 | /// 62 | public string Name 63 | { 64 | get 65 | { 66 | return this.LongName ?? this.ShortNameAsString; 67 | } 68 | } 69 | 70 | /// 71 | /// Gets or sets a value indicating whether this option takes an argument. 72 | /// 73 | public OptionArgument Argument { get; set; } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/INotifyPropertyChanged/NotifyPropertyChangedBase.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System; 8 | using System.ComponentModel; 9 | using System.Linq.Expressions; 10 | 11 | /// 12 | /// A base class for classes that need to implement . 13 | /// 14 | /// The type of the derived class. 15 | public abstract class NotifyPropertyChangedBase : INotifyPropertyChanged 16 | where TObject : NotifyPropertyChangedBase 17 | { 18 | /// 19 | /// The backing delegate for . 20 | /// 21 | private PropertyChangedEventHandler propertyChanged; 22 | 23 | /// 24 | /// Provides notification of changes to a property value. 25 | /// 26 | public event PropertyChangedEventHandler PropertyChanged 27 | { 28 | add { this.propertyChanged += value; } 29 | remove { this.propertyChanged -= value; } 30 | } 31 | 32 | /// 33 | /// Raises for the Items[] property. 34 | /// 35 | protected void OnItemsPropertyChanged() 36 | { 37 | this.propertyChanged.RaiseItems(this); 38 | } 39 | 40 | /// 41 | /// Raises for the given property. 42 | /// 43 | /// The type of the property. 44 | /// The lambda expression identifying the property that changed. 45 | protected void OnPropertyChanged(Expression> expression) 46 | { 47 | // The cast of "this" to TObject will always succeed due to the generic constraint on this class 48 | this.propertyChanged.Raise((TObject)this, expression); 49 | } 50 | 51 | /// 52 | /// Raises for all properties. 53 | /// 54 | protected void OnPropertyChanged() 55 | { 56 | this.propertyChanged.Raise(this); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/HashAlgorithmExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink 6 | { 7 | using System.Security.Cryptography; 8 | 9 | /// 10 | /// Provides OpenSSL-like extension methods for and derived classes. 11 | /// 12 | public static class HashAlgorithmExtensions 13 | { 14 | /// 15 | /// Updates the hash value by hashing the provided byte buffer. should be called before invoking this method for the first time. 16 | /// 17 | /// The hash algorithm, including its state. 18 | /// The input byte array to include in the hash calculation. 19 | /// The offset into the input byte array from which to begin using data. 20 | /// The number of bytes in the input byte array to use as data. 21 | public static void Update(this HashAlgorithm hash, byte[] buffer, int offset, int count) 22 | { 23 | hash.TransformBlock(buffer, offset, count, null, 0); 24 | } 25 | 26 | /// 27 | /// Updates the hash value by hashing the provided byte buffer. should be called before invoking this method for the first time. 28 | /// 29 | /// The hash algorithm, including its state. 30 | /// The input byte array to include in the hash calculation. 31 | public static void Update(this HashAlgorithm hash, byte[] buffer) 32 | { 33 | hash.TransformBlock(buffer, 0, buffer.Length, null, 0); 34 | } 35 | 36 | /// 37 | /// Finishes the hash calculation and returns the calculated hash value (). This method should only be called once. 38 | /// 39 | /// The hash algorithm, including its state. 40 | /// The calcualted hash value. 41 | public static byte[] Final(this HashAlgorithm hash) 42 | { 43 | hash.TransformFinalBlock(new byte[0], 0, 0); 44 | return hash.Hash; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/Nito.KitchenSink.OptionParsing.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NET40", "NET40\NET40.csproj", "{61BB0B58-3BC6-41BB-A776-C60722903E45}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4E3761FC-3133-49A8-B8BA-D0A57FC64F69}" 9 | ProjectSection(SolutionItems) = preProject 10 | Local.testsettings = Local.testsettings 11 | Nito.KitchenSink.OptionParsing.vsmdi = Nito.KitchenSink.OptionParsing.vsmdi 12 | TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(TestCaseManagementSettings) = postSolution 17 | CategoryFile = Nito.KitchenSink.OptionParsing.vsmdi 18 | EndGlobalSection 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | CodeAnalysis|Any CPU = CodeAnalysis|Any CPU 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU 26 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU 27 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 28 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.Debug|Any CPU.Build.0 = Debug|Any CPU 29 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {61BB0B58-3BC6-41BB-A776-C60722903E45}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.CodeAnalysis|Any CPU.ActiveCfg = Release|Any CPU 32 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.CodeAnalysis|Any CPU.Build.0 = Release|Any CPU 33 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {5BD6F290-F284-4CC5-9C95-655FB4E4ABB8}.Release|Any CPU.Build.0 = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.SimpleParsers/SimpleParserAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.SimpleParsers 6 | { 7 | using System; 8 | using System.Diagnostics.Contracts; 9 | 10 | /// 11 | /// Specifies that a given parser should be used for this type or member. 12 | /// 13 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property)] 14 | public sealed class SimpleParserAttribute : Attribute 15 | { 16 | private Type parserType; 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// Type of the parser. 22 | public SimpleParserAttribute(Type parserType) 23 | { 24 | Contract.Requires(parserType != null); 25 | Contract.Requires(parserType.GetInterface("Nito.KitchenSink.SimpleParsers.ISimpleParser") != null, "The type passed to SimpleParserAttribute must implement ISimpleParser."); 26 | 27 | this.parserType = parserType; 28 | } 29 | 30 | /// 31 | /// Gets or sets the type of the parser. 32 | /// 33 | /// The type of the parser. 34 | public Type ParserType 35 | { 36 | get 37 | { 38 | Contract.Ensures(Contract.Result() != null); 39 | Contract.Ensures(Contract.Result().GetInterface("Nito.KitchenSink.SimpleParsers.ISimpleParser") != null); 40 | 41 | return this.parserType; 42 | } 43 | 44 | set 45 | { 46 | Contract.Requires(value != null); 47 | Contract.Requires(value.GetInterface("Nito.KitchenSink.SimpleParsers.ISimpleParser") != null, "The type passed to SimpleParserAttribute must implement ISimpleParser."); 48 | 49 | this.parserType = value; 50 | } 51 | } 52 | 53 | [ContractInvariantMethod] 54 | private void ObjectInvariant() 55 | { 56 | Contract.Invariant(this.parserType != null); 57 | Contract.Invariant(this.parserType.GetInterface("Nito.KitchenSink.SimpleParsers.ISimpleParser") != null); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Source/Tests/Unit Tests/StreamExtensionsUnitTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Nito.KitchenSink; 7 | using System.IO; 8 | using System.IO.Compression; 9 | 10 | namespace UnitTests 11 | { 12 | [TestClass] 13 | public class StreamExtensionsUnitTests 14 | { 15 | [TestMethod] 16 | public void TryGetLength_OnStreamWithKnownLength_ReturnsLength() 17 | { 18 | var files = Directory.GetFiles("."); 19 | using (var stream = File.OpenRead(files[0])) 20 | { 21 | Assert.AreEqual(stream.Length, stream.TryGetLength(), "TryGetLength should return Length if possible"); 22 | } 23 | } 24 | 25 | [TestMethod] 26 | public void TryGetLength_OnStreamWithoutKnownLength_ReturnsLength() 27 | { 28 | using (var memoryStream = new MemoryStream()) 29 | using (var stream = new GZipStream(memoryStream, CompressionMode.Compress)) 30 | { 31 | Assert.AreEqual(-1, stream.TryGetLength(), "TryGetLength should return -1 if the length cannot be determined"); 32 | } 33 | } 34 | 35 | [TestMethod] 36 | public void StreamCopy_CopiesStream() 37 | { 38 | byte[] originalData = Guid.NewGuid().ToByteArray(); 39 | using (var sourceStream = new MemoryStream(originalData)) 40 | using (var destinationStream = new MemoryStream()) 41 | { 42 | byte[] buffer = new byte[2]; 43 | sourceStream.CopyTo(destinationStream, buffer, null); 44 | Assert.IsTrue(originalData.SequenceEqual(destinationStream.ToArray()), "CopyTo should copy the stream"); 45 | } 46 | } 47 | 48 | [TestMethod] 49 | public void StreamCopy_InvokesProgress() 50 | { 51 | bool progressInvoked = false; 52 | byte[] originalData = Guid.NewGuid().ToByteArray(); 53 | using (var sourceStream = new MemoryStream(originalData)) 54 | using (var destinationStream = new MemoryStream()) 55 | { 56 | byte[] buffer = new byte[32]; 57 | sourceStream.CopyTo(destinationStream, buffer, _ => progressInvoked = true); 58 | Assert.IsTrue(progressInvoked, "CopyTo should invoke its progress callback"); 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Dynamic/RefOutArg.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2010 Nito Programs. 3 | // 4 | 5 | using System; 6 | namespace Nito.KitchenSink.Dynamic 7 | { 8 | /// 9 | /// A wrapper around a "ref" or "out" argument invoked dynamically. 10 | /// 11 | public sealed class RefOutArg 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | private RefOutArg() 17 | { 18 | } 19 | 20 | /// 21 | /// Gets or sets the wrapped value as an object. 22 | /// 23 | public object ValueAsObject { get; set; } 24 | 25 | /// 26 | /// Gets or sets the wrapped value. 27 | /// 28 | public dynamic Value 29 | { 30 | get 31 | { 32 | return this.ValueAsObject; 33 | } 34 | 35 | set 36 | { 37 | this.ValueAsObject = value; 38 | } 39 | } 40 | 41 | /// 42 | /// Creates a new instance of the class wrapping the default value of . 43 | /// 44 | /// The type of value to wrap. 45 | /// A new instance of the class wrapping the default value of . 46 | public static RefOutArg Create() 47 | { 48 | return new RefOutArg { ValueAsObject = default(T) }; 49 | } 50 | 51 | /// 52 | /// Creates a new instance of the class wrapping the specified value. 53 | /// 54 | /// The value to wrap. 55 | /// A new instance of the class wrapping the specified value. 56 | public static RefOutArg Create(object value) 57 | { 58 | return new RefOutArg { ValueAsObject = value }; 59 | } 60 | 61 | /// 62 | /// Returns a that represents this instance. 63 | /// 64 | /// A that represents this instance. 65 | public override string ToString() 66 | { 67 | return Convert.ToString(this.ValueAsObject); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/NotifyPropertyChangedBase.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.NotifyPropertyChanged 6 | { 7 | using System; 8 | using System.ComponentModel; 9 | using System.Linq.Expressions; 10 | using System.Diagnostics.Contracts; 11 | 12 | /// 13 | /// A base class for classes that need to implement . 14 | /// 15 | /// The type of the derived class. 16 | public abstract class NotifyPropertyChangedBase : INotifyPropertyChanged 17 | where TObject : NotifyPropertyChangedBase 18 | { 19 | /// 20 | /// The backing delegate for . 21 | /// 22 | private PropertyChangedEventHandler propertyChanged; 23 | 24 | /// 25 | /// Provides notification of changes to a property value. 26 | /// 27 | public event PropertyChangedEventHandler PropertyChanged 28 | { 29 | add { this.propertyChanged += value; } 30 | remove { this.propertyChanged -= value; } 31 | } 32 | 33 | /// 34 | /// Raises for the Items[] property. 35 | /// 36 | protected void OnItemsPropertyChanged() 37 | { 38 | this.propertyChanged.RaiseItems(this); 39 | } 40 | 41 | /// 42 | /// Raises for the given property. 43 | /// 44 | /// The type of the property. 45 | /// The lambda expression identifying the property that changed. May not be null. 46 | protected void OnPropertyChanged(Expression> expression) 47 | { 48 | Contract.Requires(expression != null); 49 | 50 | // The cast of "this" to TObject will always succeed due to the generic constraint on this class 51 | this.propertyChanged.Raise((TObject)this, expression); 52 | } 53 | 54 | /// 55 | /// Raises for all properties. 56 | /// 57 | protected void OnPropertyChanged() 58 | { 59 | this.propertyChanged.Raise(this); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink/Options/OptionParsingException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Nito.KitchenSink.Options 7 | { 8 | /// 9 | /// An error was encountered during command-line option parsing. 10 | /// 11 | public class OptionParsingException : Exception 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The message. 17 | public OptionParsingException(string message) 18 | : base(message) 19 | { 20 | } 21 | 22 | /// 23 | /// An option argument error was encountered during command-line option parsing. 24 | /// 25 | public class OptionArgumentException : OptionParsingException 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The message. 31 | public OptionArgumentException(string message) 32 | : base(message) 33 | { 34 | } 35 | } 36 | 37 | /// 38 | /// An unknown option was encountered during command-line option parsing. 39 | /// 40 | public class UnknownOptionException : OptionParsingException 41 | { 42 | /// 43 | /// Initializes a new instance of the class. 44 | /// 45 | /// The message. 46 | public UnknownOptionException(string message) 47 | : base(message) 48 | { 49 | } 50 | } 51 | 52 | /// 53 | /// An invalid option or argument was encountered during command-line option parsing. 54 | /// 55 | public class InvalidParameterException : OptionParsingException 56 | { 57 | /// 58 | /// Initializes a new instance of the class. 59 | /// 60 | /// The message. 61 | public InvalidParameterException(string message) 62 | : base(message) 63 | { 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.NotifyPropertyChanged/INotifyPropertyChangedExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.NotifyPropertyChanged 6 | { 7 | using System; 8 | using System.ComponentModel; 9 | using System.Linq.Expressions; 10 | using Nito.KitchenSink.GetPropertyName; 11 | using System.Diagnostics.Contracts; 12 | 13 | /// 14 | /// Provides extension methods for objects implementing . 15 | /// 16 | public static class INotifyPropertyChangedExtensions 17 | { 18 | /// 19 | /// Subscribes a handler to the event for a specific property. 20 | /// 21 | /// The type implementing . 22 | /// The type of the property. 23 | /// The object implementing . May not be null. 24 | /// The lambda expression selecting the property. May not be null. 25 | /// The handler that is invoked when the property changes. May not be null. 26 | /// The actual delegate subscribed to . 27 | public static PropertyChangedEventHandler SubscribeToPropertyChanged( 28 | this TObject source, 29 | Expression> expression, 30 | Action handler) 31 | where TObject : INotifyPropertyChanged 32 | { 33 | Contract.Requires(source != null); 34 | Contract.Requires(expression != null); 35 | Contract.Requires(handler != null); 36 | 37 | // This is similar but not identical to: 38 | // http://www.ingebrigtsen.info/post/2008/12/11/INotifyPropertyChanged-revisited.aspx 39 | string propertyName = source.GetPropertyName(expression); 40 | PropertyChangedEventHandler ret = (s, e) => 41 | { 42 | if (e.PropertyName == propertyName || e.PropertyName == string.Empty) 43 | { 44 | handler(source); 45 | } 46 | }; 47 | source.PropertyChanged += ret; 48 | return ret; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Source/Nito.KitchenSink.OptionParsing/NET40/OptionPresentAttribute.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Nito Programs. 3 | // 4 | 5 | namespace Nito.KitchenSink.OptionParsing 6 | { 7 | using System; 8 | using System.Diagnostics.Contracts; 9 | 10 | /// 11 | /// Specifies that the presence of a command-line option sets this property. 12 | /// 13 | [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] 14 | public sealed class OptionPresentAttribute : Attribute 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | /// The long name of the option. The long name may not contain ':' or '=' characters. 20 | public OptionPresentAttribute(string longName) 21 | { 22 | this.LongName = longName; 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | /// The short name of the option, if any. The short name may not be ':' or '='. 29 | public OptionPresentAttribute(char shortName) 30 | { 31 | this.ShortName = shortName; 32 | } 33 | 34 | /// 35 | /// Gets or sets the long name of the option. The long name may not contain ':' or '=' characters. 36 | /// 37 | public string LongName { get; set; } 38 | 39 | /// 40 | /// Gets or sets the short name of the option, if any. The short name may not be ':' or '='. 41 | /// 42 | public char? ShortName { get; set; } 43 | 44 | /// 45 | /// Gets the short name of the option as a string. 46 | /// 47 | public string ShortNameAsString 48 | { 49 | get 50 | { 51 | if (this.ShortName == null) 52 | { 53 | return null; 54 | } 55 | 56 | return this.ShortName.ToString(); 57 | } 58 | } 59 | 60 | /// 61 | /// Gets the long name, if any; otherwise, gets the short name, if any. 62 | /// 63 | public string Name 64 | { 65 | get 66 | { 67 | return this.LongName ?? this.ShortNameAsString; 68 | } 69 | } 70 | } 71 | } 72 | --------------------------------------------------------------------------------