This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added NET 3.5 version of FatturaElettronica.Core
- Loading branch information
1 parent
b92c41a
commit 6576543
Showing
15 changed files
with
436 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)] | ||
public sealed class CallerMemberNameAttribute : Attribute | ||
{ | ||
public CallerMemberNameAttribute() | ||
{ | ||
} | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)] | ||
public sealed class CallerLineNumberAttribute : Attribute | ||
{ | ||
public CallerLineNumberAttribute() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
|
||
namespace System.Reflection | ||
{ | ||
|
||
static class ReflectionExtensions | ||
{ | ||
public static TypeInfo GetTypeInfo(this Type source) | ||
{ | ||
return new TypeInfo(source); | ||
} | ||
|
||
readonly static object[] EmptyArray = new object[0]; | ||
|
||
public static PropertyInfo[] GetRuntimeProperties(this Type type) | ||
{ | ||
return type.GetProperties(); | ||
} | ||
|
||
public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo member, bool inherit = false) | ||
where T : Attribute | ||
{ | ||
return (member.GetCustomAttributes(typeof(T), false) ?? EmptyArray) | ||
.OfType<T>(); | ||
} | ||
|
||
public static T GetCustomAttribute<T>(this MemberInfo member, bool inherit = false) | ||
where T : Attribute | ||
{ | ||
return (member.GetCustomAttributes(typeof(T), false) ?? EmptyArray).OfType<T>().Single(); | ||
} | ||
|
||
public static IEnumerable<MethodInfo> GetRuntimeMethods(this Type type) | ||
{ | ||
return type.GetMethods(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Reflection; | ||
|
||
namespace System | ||
{ | ||
public class TypeInfo : Type | ||
{ | ||
readonly Type type; | ||
readonly static MethodInfo MethodGetAttributeFlagsImpl = | ||
typeof(Type).GetMethod(nameof(GetAttributeFlagsImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodGetConstructorImpl = | ||
typeof(Type).GetMethod(nameof(GetConstructorImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodGetMethodImpl = | ||
typeof(Type).GetMethod(nameof(GetMethodImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodGetPropertyImpl = | ||
typeof(Type).GetMethod(nameof(GetPropertyImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodHasElementTypeImpl = | ||
typeof(Type).GetMethod(nameof(HasElementTypeImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodIsArrayImpl = | ||
typeof(Type).GetMethod(nameof(IsArrayImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodIsByRefImpl = | ||
typeof(Type).GetMethod(nameof(IsByRefImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodIsCOMObjectImpl = | ||
typeof(Type).GetMethod(nameof(IsCOMObjectImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodIsPointerImpl = | ||
typeof(Type).GetMethod(nameof(IsPointerImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
readonly static MethodInfo MethodIsPrimitiveImpl = | ||
typeof(Type).GetMethod(nameof(IsPrimitiveImpl), BindingFlags.Instance | BindingFlags.NonPublic); | ||
|
||
internal TypeInfo(Type type) => this.type = type; | ||
|
||
public override Guid GUID => type.GUID; | ||
|
||
public override Module Module => type.Module; | ||
|
||
public override Assembly Assembly => type.Assembly; | ||
|
||
public override string FullName => type.FullName; | ||
|
||
public override string Namespace => type.Namespace; | ||
|
||
public override string AssemblyQualifiedName => type.AssemblyQualifiedName; | ||
|
||
public override Type BaseType => type.BaseType; | ||
|
||
public override Type UnderlyingSystemType => type.UnderlyingSystemType; | ||
|
||
public override string Name => type.Name; | ||
|
||
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => type.GetConstructors(bindingAttr); | ||
|
||
public override object[] GetCustomAttributes(bool inherit) => type.GetCustomAttributes(inherit); | ||
|
||
public override object[] GetCustomAttributes(Type attributeType, bool inherit) => type.GetCustomAttributes(attributeType, inherit); | ||
|
||
public override Type GetElementType() => type.GetElementType(); | ||
|
||
public override EventInfo GetEvent(string name, BindingFlags bindingAttr) => type.GetEvent(name, bindingAttr); | ||
|
||
public override EventInfo[] GetEvents(BindingFlags bindingAttr) => type.GetEvents(bindingAttr); | ||
|
||
public override FieldInfo GetField(string name, BindingFlags bindingAttr) => GetField(name, bindingAttr); | ||
|
||
public override FieldInfo[] GetFields(BindingFlags bindingAttr) => GetFields(bindingAttr); | ||
|
||
public override Type GetInterface(string name, bool ignoreCase) => type.GetInterface(name, ignoreCase); | ||
|
||
public override Type[] GetInterfaces() => type.GetInterfaces(); | ||
|
||
public override MemberInfo[] GetMembers(BindingFlags bindingAttr) => type.GetMembers(bindingAttr); | ||
|
||
public override MethodInfo[] GetMethods(BindingFlags bindingAttr) => type.GetMethods(bindingAttr); | ||
|
||
public override Type GetNestedType(string name, BindingFlags bindingAttr) => type.GetNestedType(name, bindingAttr); | ||
|
||
public override Type[] GetNestedTypes(BindingFlags bindingAttr) => type.GetNestedTypes(bindingAttr); | ||
|
||
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) => GetProperties(bindingAttr); | ||
|
||
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) => type.InvokeMember(name, invokeAttr, binder, target, args); | ||
|
||
public override bool IsDefined(Type attributeType, bool inherit) => type.IsDefined(attributeType, inherit); | ||
|
||
protected override TypeAttributes GetAttributeFlagsImpl() => (TypeAttributes)MethodGetAttributeFlagsImpl.Invoke(type, null); | ||
|
||
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) => (ConstructorInfo)MethodGetConstructorImpl.Invoke(type, new object[] { bindingAttr, binder, callConvention, type, modifiers }); | ||
|
||
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) => (MethodInfo)MethodGetMethodImpl.Invoke(type, new object[] { name, bindingAttr, binder, callConvention, type, modifiers }); | ||
|
||
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) => (PropertyInfo)MethodGetPropertyImpl.Invoke(type, new object[] { name, bindingAttr, binder, returnType, type, modifiers }); | ||
|
||
protected override bool HasElementTypeImpl() => (bool)MethodHasElementTypeImpl.Invoke(type, null); | ||
|
||
protected override bool IsArrayImpl() => (bool)MethodIsArrayImpl.Invoke(type, null); | ||
|
||
protected override bool IsByRefImpl() => (bool)MethodIsByRefImpl.Invoke(type, null); | ||
|
||
protected override bool IsCOMObjectImpl() => (bool)MethodIsCOMObjectImpl.Invoke(type, null); | ||
|
||
protected override bool IsPointerImpl() => (bool)MethodIsPointerImpl.Invoke(type, null); | ||
|
||
protected override bool IsPrimitiveImpl() => (bool)MethodIsPrimitiveImpl.Invoke(type, null); | ||
|
||
public IEnumerable<Type> GenericTypeArguments => type.GetGenericArguments(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{555A2179-AEB8-4B3D-AA3F-92EE3DC9FE62}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>FatturaElettronica.Core</RootNamespace> | ||
<AssemblyName>FatturaElettronica.Core</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>TRACE;DEBUG;NET35</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net35\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\Core\BaseClass.cs"> | ||
<Link>BaseClass.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\BaseClassSerializable.cs"> | ||
<Link>BaseClassSerializable.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\DataPropertyAttribute.cs"> | ||
<Link>DataPropertyAttribute.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\IgnoreXmlDateFormat.cs"> | ||
<Link>IgnoreXmlDateFormat.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\JsonOptions.cs"> | ||
<Link>JsonOptions.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\JsonParseException.cs"> | ||
<Link>JsonParseException.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\TypeExtensions.cs"> | ||
<Link>TypeExtensions.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Core\XmlOptions.cs"> | ||
<Link>XmlOptions.cs</Link> | ||
</Compile> | ||
<Compile Include="Compatibily\CompilerServices.cs" /> | ||
<Compile Include="Compatibily\Reflection.cs" /> | ||
<Compile Include="Compatibily\TypeInfo.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("FatturaElettronica.NET")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("CIR 2000")] | ||
[assembly: AssemblyProduct("FatturaElettronica.NET")] | ||
[assembly: AssemblyCopyright("Copyright © CIR2000 2017")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("555a2179-aeb8-4b3d-aa3f-92ee3dc9fe62")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net35" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace NUnit.Framework | ||
{ | ||
|
||
public class TestClass : TestFixtureAttribute { } | ||
|
||
public class TestMethod : TestAttribute { } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Test(3.5)")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Test(3.5)")] | ||
[assembly: AssemblyCopyright("Copyright © 2018")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("2afbf850-0a3f-4265-9a3f-066a2d731e61")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.