Table of Contents

Class CollectionWithoutDuplicatesBaseDC<T>

Namespace
SunamoDevCode._public.SunamoCollectionWithoutDuplicates
Assembly
SunamoDevCode.dll

Base class for collections without duplicates

public abstract class CollectionWithoutDuplicatesBaseDC<T>

Type Parameters

T
Inheritance
CollectionWithoutDuplicatesBaseDC<T>
Derived
Inherited Members
Extension Methods

Constructors

CollectionWithoutDuplicatesBaseDC()

Initializes a new collection without duplicates

public CollectionWithoutDuplicatesBaseDC()

CollectionWithoutDuplicatesBaseDC(IList<T>)

Initializes a new collection from existing list

public CollectionWithoutDuplicatesBaseDC(IList<T> initialList)

Parameters

initialList IList<T>

Initial list of items

CollectionWithoutDuplicatesBaseDC(int)

Initializes a new collection with specified capacity

public CollectionWithoutDuplicatesBaseDC(int capacity)

Parameters

capacity int

Initial capacity

Properties

AllowNull

Gets or sets whether null values are allowed

public bool? AllowNull { get; set; }

Property Value

bool?

BreakOnConstruction

Gets or sets whether to break on construction for debugging

public static bool BreakOnConstruction { get; set; }

Property Value

bool

Collection

Gets or sets the internal collection

public List<T> Collection { get; set; }

Property Value

List<T>

ItemString

Gets or sets the string representation of the current item

protected string ItemString { get; set; }

Property Value

string

StringRepresentations

Gets or sets the string representations for comparison

public List<string> StringRepresentations { get; set; }

Property Value

List<string>

Methods

Add(T)

Adds a value to the collection if it doesn't exist

public bool Add(T value)

Parameters

value T

Value to add

Returns

bool

True if value was added, false if it already existed

AddRange(IList<T>)

Adds range of items to the collection

public List<T> AddRange(IList<T> list)

Parameters

list IList<T>

List of items to add

Returns

List<T>

List of items that were not added (already existed)

AddWithIndex(T)

Adds value and returns its index

public abstract int AddWithIndex(T value)

Parameters

value T

Value to add

Returns

int

Index of the value

Contains(T)

Checks if the collection contains the specified value

public abstract bool? Contains(T value)

Parameters

value T

Value to check

Returns

bool?

True if contains, false if not, null if value is null and nulls are not allowed

DumpAsString(string, object)

Dumps collection as string

public string DumpAsString(string operation, object dumpAsStringHeaderArgs)

Parameters

operation string

Operation name

dumpAsStringHeaderArgs object

Header arguments

Returns

string

String representation

IndexOf(T)

Gets the index of the specified value

public abstract int IndexOf(T value)

Parameters

value T

Value to find

Returns

int

Index of the value

IsComparingByString()

Determines if comparison is done by string representation

protected abstract bool IsComparingByString()

Returns

bool

True if comparing by string