Table of Contents

Class BaseModel

Namespace
Tlabs.JobCntrl.Model
Assembly
Tlabs.JobCntrl.dll

Abstract base model.

public abstract class BaseModel : IModel, IDisposable
Inheritance
BaseModel
Implements
Derived
Inherited Members
Extension Methods

Constructors

BaseModel()

Default ctor.

protected BaseModel()

BaseModel(string, string?, IReadOnlyDictionary<string, object?>?)

Ctor from base properties.

protected BaseModel(string name, string? description, IReadOnlyDictionary<string, object?>? properties)

Parameters

name string
description string
properties IReadOnlyDictionary<string, object>

Properties

Description

Model description.

public string Description { get; }

Property Value

string

Name

Model name.

public string Name { get; }

Property Value

string

Properties

Model properties.

public IReadOnlyDictionary<string, object?> Properties { get; }

Property Value

IReadOnlyDictionary<string, object>

Methods

Dispose()

Dispose

public void Dispose()

Dispose(bool)

dispose when == true.

protected abstract void Dispose(bool disposing)

Parameters

disposing bool

InitBase(string, string?, IReadOnlyDictionary<string, object?>?)

Base init.

protected void InitBase(string name, string? description, IReadOnlyDictionary<string, object?>? properties)

Parameters

name string
description string
properties IReadOnlyDictionary<string, object>

Remarks

Used to support implementing Job.Initialize()...

PropertyBool(string, bool)

Return a property's boolean value or defaultVal if not existing or not convertible to bool.

public bool PropertyBool(string propKey, bool defaultVal)

Parameters

propKey string
defaultVal bool

Returns

bool

PropertyEnum(string, Enum)

Return an enumeration member named by the property's string value or defaultEnum if not existing.

public object PropertyEnum(string propKey, Enum defaultEnum)

Parameters

propKey string
defaultEnum Enum

Returns

object

Exceptions

ArgumentException

if property's string value is not a named constant of the enumeration

PropertyInt(string, int)

Return a property's integer value or defaultVal if not existing or not convertible to int.

public int PropertyInt(string propKey, int defaultVal)

Parameters

propKey string
defaultVal int

Returns

int

PropertyString(string)

Return a property's string value or null if not existing or not a string.

public string? PropertyString(string propKey)

Parameters

propKey string

Returns

string

PropertyString(string, string)

Return a property's string value or defaultVal if not existing or not a string.

public string PropertyString(string propKey, string defaultVal)

Parameters

propKey string
defaultVal string

Returns

string