Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dgmjr committed Apr 13, 2023
0 parents commit 3138bc7
Show file tree
Hide file tree
Showing 28 changed files with 4,814 additions and 0 deletions.
2,393 changes: 2,393 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions Dgmjr.System.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
Dgmjr.Extensions.csproj
Created: 2022-10-23-11:18:23
Modified: 2022-11-01-06:59:08
Author: David G. Mooore, Jr. <david@dgmjr.io>
Copyright © 2022-2023 David G. Mooore, Jr., All Rights Reserved
License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1;netstandard2.0;netstandard1.5;netstandard1.3</TargetFrameworks>
<!-- <TargetFramework>net7.0</TargetFramework> -->
<PackageId>Dgmjr.System.Extensions</PackageId>
<RootNamespace>System.Extensions</RootNamespace>
<AssemblyName>Dgmjr.System.Extensions</AssemblyName>
<EnableGlobalCodeGenerators>false</EnableGlobalCodeGenerators>
<SlnGenSolutionFolder>src</SlnGenSolutionFolder>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<Title>Dgmjr.System.Extensions</Title>
<Description>Extensions and utility classes for the System namespace</Description>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Usings" />
<PackageReference Include="System.Text.Usings" IncludeAssets="Build" ExcludeAssets="Compile;Runtime;Native;Analyzers" />
<PackageReference Include="system.Xml.ReaderWriter" Condition="$(TargetFramework.StartsWith('net6')) Or $(TargetFramework.StartsWith('net7'))" />
<PackageReference Include="System.Xml.XDocument" Aliases="XDoc" Condition="$(TargetFramework.StartsWith('netstandard1'))"/>
<PackageReference Include="System.Xml.XPath.XDocument" Aliases="XPathDoc" Condition="$(TargetFramework.StartsWith('netstandard1'))" />
<PackageReference Include="NETStandard.Library" Aliases="NetStd" Condition="$(TargetFramework.StartsWith('netstandard2'))" />
</ItemGroup>
<Target Name="PrePack" BeforeTargets="GetPackageContents" Condition="$(TargetFramework.StartsWith('netstandard1'))">
<ItemGroup>
<PackageFile Include="$(OutputPath)**/System.Xml.XDocument.dll" />
<PackageFile Remove="$(OutputPath)**/System.Runtime.Numerics.dll" />
<None Remove="$(OutputPath)**/System.Runtime.Numerics.dll" />
<Reference Remove="System.Runtime.Numerics" />
</ItemGroup>
</Target>
<ItemGroup Condition="$(TargetFramework.Contains('netstandard1'))">
<Compile Remove="./System.ComponentModel/**/*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('netstandard')) Or '$(TargetFramework)' == 'net5.0'">
<Compile Remove="./System.Text.Json/*.cs" />
</ItemGroup>
<Target Name="RemoveXDocument" BeforeTargets="CoreCompile">
<!-- <ItemGroup>
<PackageReference Remove="System.Xml.XDocument" />
<Reference Include="System.Xml.XDocument" Condition="$(TargetFramework.Contains('netstandard1'))" Aliases="XDoc" />
</ItemGroup> -->
</Target>
</Project>
41 changes: 41 additions & 0 deletions Dgmjr.System.Extensions.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
* Dgmjr.System.Extensions.props
*
* Created: 2023-03-13-05:47:59
* Modified: 2023-03-30-03:48:47
*
* Author: David G. Moore, Jr. <david@dgmjr.io>
*
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Condition="!$(TargetFramework.StartsWith('netstandard1'))">
<Using Include="System.Xml.Serialization.XmlAnyAttributeAttribute" Alias="XAnyAttr" />
<Using Include="System.Xml.Serialization.XmlAnyElementAttribute" Alias="XAnyElem" />
<Using Include="System.Xml.Serialization.XmlArrayAttribute" Alias="XArray" />
<Using Include="System.Xml.Serialization.XmlArrayItemAttribute" Alias="XArrayItem" />
<Using Include="System.Xml.Serialization.XmlAttributeAttribute" Alias="XAttr" />
<Using Include="System.Xml.Serialization.XmlEnumAttribute" Alias="XEnum" />
<Using Include="System.Xml.Serialization.XmlEnumAttribute" Alias="XEnumVal" />
<Using Include="System.Xml.Serialization.XmlIgnoreAttribute" Alias="XIgnore" />
<Using Include="System.Xml.Serialization.XmlIncludeAttribute" Alias="XInclude" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNs" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsPfx" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsUri" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDecl" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDeclPfx" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDeclUri" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDeclNs" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDeclNsPfx" />
<Using Include="System.Xml.Serialization.XmlNamespaceDeclarationsAttribute" Alias="XNsDeclNsUri" />
<Using Include="System.Xml.Serialization.XmlRootAttribute" Alias="XRoot" />
<Using Include="System.Xml.Serialization.XmlTextAttribute" Alias="XText" />
<Using Include="System.Xml.Serialization.XmlTypeAttribute" Alias="XType" />
<Using Include="System.Xml.Serialization.XmlElementAttribute" Alias="XElem" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions Dgmjr.System.Extensions.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05F5941D-1F1E-44B8-9852-78DE517FDB69}
EndGlobalSection
EndGlobal
30 changes: 30 additions & 0 deletions Dgmjr.System.Extensions.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
* Dgmjr.System.Extensions.props
*
* Created: 2022-11-12-07:27:11
* Modified: 2022-11-12-07:27:11
*
* Author: David G. Mooore, Jr. <david@dgmjr.io>
*
* Copyright © 2022-2023 David G. Mooore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->
<Project>
<ItemGroup>
<Compile Remove="./System.Xml/XmlExtensions.cs" Condition="!$(DefineConstants.Contains('NETSTANDARD2_0_OR_GREATER'))" />
</ItemGroup>
<ItemGroup>
<!-- <Compile Remove="./System.Text/*" Condition="!$(DefineConstants.Contains('INCLUDE_SYSTEM_TEXT'))" />
<Compile Remove="./System.Xml/*" Condition="!$(DefineConstants.Contains('INCLUDE_XML'))" />
<Compile Remove="./System.Linq/*" Condition="!$(DefineConstants.Contains('INCLUDE_LINQ'))" />
<Compile Remove="./System/Math.cs" Condition="!$(DefineConstants.Contains('INCLUDE_MATH_EXTENSIONS'))" />
<Compile Remove="./System/Randoms.cs" Condition="!$(DefineConstants.Contains('INCLUDE_RANDOMS'))" />
<Compile Remove="./System/*Uri*.cs" Condition="!$(DefineConstants.Contains('INCLUDE_URI_EXTENSIONS'))" /> -->
<PackageFile Include="@(Compile)" Except="$(IntermediateOutputPath)**/*" PackagePath="ContentFiles/%(RecursiveDir)%(Filename)%(Extension)" />
<!-- <Compile Remove="@(Compile)" /> -->
<!-- <Using Remove="@(Using)" /> -->
<None Remove="**/$(AssemblyName).*" />
<Using Remove="System.Net.Http" />
<Using Remove="System.Console" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#if !IS_EXTERNAL_INIT_DEFINED
#define IS_EXTERNAL_INIT_DEFINED
namespace System.Runtime.CompilerServices;

internal class IsExternalInit { }
#endif
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
authors:
- dgmjr
title: DGMJR System.Extensions
lastmod: 2023-03-30T17:25:50.755Z
created: 2023-03-13-05:47:59
project: DGMJR System.Extensions
license: MIT
project: "System.Types"
keywords:
- extensions
- system
categories:
- extensions
type: readme
slug: dgmjr-system-extensions
description: This is a collection of extensions for primary System.* namespaced classes in .NET.
---


# DGMJR System.Extensions

This is a collection of extensions for primary System.* namespaced classes in .NET.
158 changes: 158 additions & 0 deletions SR.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!-- Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. -->
<xsd:schema id="root"
xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root"
msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value"
type="xsd:string"
minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name"
use="required"
type="xsd:string" />
<xsd:attribute name="type"
type="xsd:string" />
<xsd:attribute name="mimetype"
type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias"
type="xsd:string" />
<xsd:attribute name="name"
type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value"
type="xsd:string"
minOccurs="0"
msdata:Ordinal="1" />
<xsd:element name="comment"
type="xsd:string"
minOccurs="0"
msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name"
type="xsd:string"
use="required"
msdata:Ordinal="1" />
<xsd:attribute name="type"
type="xsd:string"
msdata:Ordinal="3" />
<xsd:attribute name="mimetype"
type="xsd:string"
msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value"
type="xsd:string"
minOccurs="0"
msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name"
type="xsd:string"
use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="HashCode_EqualityNotSupported"
xml:space="preserve">
<value>HashCode Equality not supported</value>
<comment />
</data>
<data name="HashCode_HashCodeNotSupported"
xml:space="preserve">
<value>HashCode not supported</value>
<comment />
</data>
</root>
18 changes: 18 additions & 0 deletions System.Collections.Generic/CaseInsensitiveKeyDictionary{TValue}.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* NonCaseSensitiveKeyDictionary{TValue}.cs
*
* Created: 2023-03-31-04:47:28
* Modified: 2023-03-31-04:47:28
*
* Author: David G. Moore, Jr. <david@dgmjr.io>
*
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
*/

namespace System.Collections.Generic;

public class CaseInsensitiveKeyDictionary<TValue> : Dictionary<string, TValue>
{
public CaseInsensitiveKeyDictionary() : base(StringComparer.OrdinalIgnoreCase) { }
}
Loading

0 comments on commit 3138bc7

Please sign in to comment.