StructList 1.0.1

Suggested Alternatives

pkar.StructList

Additional Details

Since 1.3.0, I added 'pkar' prefix to package ID

There is a newer version of this package available.
See the version list below for details.
dotnet add package StructList --version 1.0.1                
NuGet\Install-Package StructList -Version 1.0.1                
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="StructList" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StructList --version 1.0.1                
#r "nuget: StructList, 1.0.1"                
#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 StructList as a Cake Addin
#addin nuget:?package=StructList&version=1.0.1

// Install StructList as a Cake Tool
#tool nuget:?package=StructList&version=1.0.1                

Helpers bases for items and lists.

Almost every app writes/read data from file, and in every app we have to place same code... This Nuget should help with this.

BaseStruct

It is base for class/struct you use in your code. If your class inherits from BaseStruct, you will get:

  • two debugging helpers, to dump properties values:

    Function DumpAsText() As String // dump of all properties' values (in something like table) Function DumpAsJSON(Optional bSkipDefaults As Boolean = False) As String // similar, but gives full dump of tree of properties as JSON dump

  • one method you can utilize in code, and sometimes even you can love it:

    Function Clone() As Object // deep Clone of item (dump to JSON and read it to new item)

BaseList

It is base for lists backed by JSON file; in many cases your app would be relieved from Nugetting JSON. Using:

VB: Class YourList Inherits BaseList(Of YourClass)
C#: class YourList : BaseList<YourClass>

Maybe you would like to override one method, called by Load if file is empty. In overrided method you can add default entries to list.

Protected Overridable Sub InsertDefaultContent()

constructor

You have to give folder for file, and you can override default file name.

 New(sFolder As String, Optional sFileName As String = "items.json")

operations on data file

Overridable Function Load() As Boolean
Overridable Function Save(Optional bIgnoreNulls As Boolean = False) As Boolean
Function GetFileDate() As Date
Function IsObsolete(iDays As Integer)

proxies for internal list

Function GetList() As List(Of TYP)
Function Count() As Integer
Sub Clear()
Sub Add(oNew As TYP)
Sub Remove(oDel As TYP)
Function Find(match As Predicate(Of TYP)) As TYP
Sub Remove(match As Predicate(Of TYP))

other functions

Function LoadItem(sJSON As String) As TYP
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 netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.4 is compatible.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on StructList:

Package Downloads
pkar.nuget.MPK

This package is only for Kraków, Poland - wrapper for public transport services. Although it can be used (in part) also for other TTSS based services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Added auto-closing serialized list on deserialization