AE.Core 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AE.Core --version 3.1.0                
NuGet\Install-Package AE.Core -Version 3.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AE.Core" Version="3.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AE.Core --version 3.1.0                
#r "nuget: AE.Core, 3.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AE.Core as a Cake Addin
#addin nuget:?package=AE.Core&version=3.1.0

// Install AE.Core as a Cake Tool
#tool nuget:?package=AE.Core&version=3.1.0                

AE.Core

Project containing data logger and serializer.

Logger

Logger can save exception, message and method name. Example:

using AE.Core.Log;

public void LogTest()
{
    ILogger logger = new Logger("error", "exeption.log");
    logger.Log("test");
}
// in exeption.log file
// [ERROR]: [21.06 03:17:20] - LogTest() - test

ILogger contains two methods:

void Log(string message, string tag = null, string method = null, bool ignoreEvent = false);
void Log(Exception ex, string message = null, string tag = null, string method = null, bool ignoreEvent = false);

ignoreEvent is needed so as not call an event LoggerHelper.OnLog

Serializer

Serializer can save and load any data. Example:

using AE.Core.Serializer;

public enum TestEnum
{
	V1,
	V2,
	V3,
}

[AESerializable]
public class TestSerializer
{
	public bool V { get; set; }
	public int V1 { get; set; }
	[AEIgnore]
	public int V1Ignore { get; set; }
	public float V2 { get; set; }
	public double V3 { get; set; }
	public string Text { get; set; }
	public DateTime Date { get; set; }
	public TimeSpan Time { get; set; }
	public DateTime? DateNull { get; set; }
	public Guid Guid { get; set; }
	public TestEnum Enum { get; set; }
	public int[] Ints { get; set; }
	public List<float> Floats { get; set; }
	public ITestClass TestInterface { get; set; }
	public SubTestSerializerClass SubTestClass { get; set; }
	public SubTestSerializerStruct SubTestStruct { get; set; }
}

public interface ITestClass
{
	string Text { get; set; }
}

[AESerializable]
public class SubTestSerializerClass : ITestClass
{
	public string Text { get; set; }
}

[AESerializable]
public struct SubTestSerializerStruct
{
	public string Text { get; set; }
}

var obj = new TestSerializer
{
	V = true,
	V1 = 1,
	V1Ignore = 1,
	V2 = 2.2f,
	V3 = 3.3,
	Text = "~[Test&^$(']",
	Date = new DateTime(2000, 1, 1),
	Time = new TimeSpan(1, 2, 3, 4, 5) - new TimeSpan(2, 3, 4, 5, 6),
	DateNull = null,
	Guid = Guid.NewGuid(),
	Enum = TestEnum.V3,
	Ints = [1, 2],
	Floats = [2.2f, 3.3f],
	TestInterface = new SubTestSerializerClass
	{
		Text = "~[Test&^$(']",
	},
	SubTestClass = new SubTestSerializerClass
	{
		Text = "~[Test&^$(']",
	},
	SubTestStruct = new SubTestSerializerStruct
	{
		Text = "~[Test&^$(']",
	},
};

string data = null;

using (var serializer = new AESerializer())
{
    // Get save data
    data = serializer.Serialize(obj);
}

obj = null;

using (var serializer = new AESerializer())
{
    // Load from data
    obj = serializer.Deserialize<TestSerializer>(data);
	// or get object
    object result = serializer.Deserialize(data);
}

SerializerHelper can save data to file as string or byte array. Example:

using AE.Core;

var test = new TestSerializer();
string data = null;

//...

SerializerHelper.SaveText(data, "fileName");

data = null;
test = null;

data = SerializerHelper.LoadText("fileName");

//...

Serializer can save all reference as one object. Example:

using AE.Core.Serializer;

[AESerializable]
public class ReferenceTestArray
{
	public string Data { get; set; }
	public Dictionary<string, ReferenceTestArrayItem> Items { get; set; }
}

[AESerializable]
public class ReferenceTestArrayItem
{
	public string Data { get; set; }
	public ReferenceTestArray Parent { get; set; }
}

var r = new ReferenceTestArray
{
	Data = "parent",
	Items = new Dictionary<string, ReferenceTestArrayItem>(),
};

var r1 = new ReferenceTestArrayItem
{
	Data = "r1",
	Parent = r,
};

var r2 = new ReferenceTestArrayItem
{
	Data = "r2",
	Parent = r,
};

r.Items.Add("1", r1);
r.Items.Add("2", r2);
r.Items.Add("3", r1);

using (var serializer = new AESerializer())
{
	var data = serializer.Serialize(r);
	// all references to objects are saved (result.Items["1"].Parent == result, etc.)
	var result = serializer.Deserialize<ReferenceTestArray>(data);
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.2 94 4/25/2024
3.2.1 106 4/3/2024
3.2.0 82 4/2/2024
3.1.0 88 3/20/2024
3.0.9 98 3/6/2024
3.0.8 95 2/27/2024
3.0.7 117 2/20/2024
3.0.6 96 2/18/2024
3.0.4 96 2/15/2024
3.0.3 99 2/14/2024
3.0.2 325 3/6/2023
3.0.1 274 2/10/2023
3.0.0 264 2/7/2023