Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pierocastillo/aurautilities
A Cross-Platform Utilities Collection for .Net Apps
https://github.com/pierocastillo/aurautilities
app application bin cross-platform net settings wpf
Last synced: 2 months ago
JSON representation
A Cross-Platform Utilities Collection for .Net Apps
- Host: GitHub
- URL: https://github.com/pierocastillo/aurautilities
- Owner: PieroCastillo
- License: mit
- Created: 2021-03-08T16:00:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-06T22:28:20.000Z (almost 3 years ago)
- Last Synced: 2024-04-13T21:47:56.213Z (9 months ago)
- Topics: app, application, bin, cross-platform, net, settings, wpf
- Language: C#
- Homepage:
- Size: 231 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AuraUtilities
A Cross-Platform Utilities Collection for .Net AppsNow available in Nuget!
```cmd
dotnet add package AuraUtilities --version 0.1.0
```## Basic Utilities for .Net Apps availables:
### Locator
```c#
//on startup
Locator.Instance.RegisterService(new SystemInfoModel());//in another context
SystemInfoModel? sys_info = Locator.Instance.GetService();
```
### SettingsProvider```c#
//on app startup
var provider = new SettingsProvider();
App.Current.Settings = provider.Load();//important: the objects in properties must be serializables, or the lib will throw an error, I recommend store the object's string representation(Color = "#FFFFFF")
[Serializable]
public class AppSettings : Settings { }//on app shutdown
var provider = new SettingsProvider();
provider.Save(App.Current.Settings);
```
### LogsService
```c#
//on app startup, if you use "null" the Logger stores the logs in the default temp directory, or you can custom another directory too.
Logger.Start(null);//in another context
Logger.WriteLine("message", MessageType.Warning); //the MessageType param is optional, the default value is "MessageType.Info"
Logger.Assert(condition == true,"message", MessageType.Warning); //the same but with a condition//Also support Async
await Logger.WriteLineAsync("message", MessageType.Warning);
```