Table of Contents

Class RoutineBlocker0

Namespace
Hi.Common
Assembly
HiGeom.dll

Block the thread to the given delay from the previous block.

public class RoutineBlocker0 : IMakeXmlSource
Inheritance
RoutineBlocker0
Implements
Inherited Members
Extension Methods

Constructors

RoutineBlocker0()

Constructor

public RoutineBlocker0()

RoutineBlocker0(XElement)

Initializes a new instance of the RoutineBlocker0 class from an XML element.

public RoutineBlocker0(XElement src)

Parameters

src XElement

The XML element containing the blocker configuration

Fields

XName

Gets the XML element name used for serialization.

public static string XName

Field Value

string

Properties

Enable

Enable the Block() function.

public bool Enable { get; set; }

Property Value

bool

Period

Delay time between each previous Block().

public TimeSpan Period { get; set; }

Property Value

TimeSpan

Methods

Block()

Delay the thread. The delay time is Period, counted from the previous Block() to the current Block(). The first function call does no delay. If the time between two Block() is over Period, the function call does no delay.

public void Block()

HasToBlock()

If calling Block() make thread delay, return true; otherwise, false.

public bool HasToBlock()

Returns

bool

Has to block

MakeXmlSource(string, string)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.