Table of Contents

Class BoundSelectorHost

Namespace
Hi.Numerical.StepSelectionUtils
Assembly
HiMech.dll

Hosts bound selectors and manages step sections within a CL strip.

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

Constructors

BoundSelectorHost()

Initializes a new instance of the BoundSelectorHost class.

public BoundSelectorHost()

BoundSelectorHost(XElement, string)

Ctor.

public BoundSelectorHost(XElement src, string baseDirectory)

Parameters

src XElement

XML source element

baseDirectory string

Base directory for resolving relative paths

Properties

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

Methods

Begin(string, BoundAnchorMode, IStepShift, FileLineIndex, int)

Marks the beginning of a step section with the specified key and parameters.

public void Begin(string key, BoundAnchorMode anchorMode, IStepShift shift, FileLineIndex fileLineIndex, int boundStepIndex)

Parameters

key string

The key identifying the step section.

anchorMode BoundAnchorMode

The anchor mode for the bound.

shift IStepShift

The step shift to apply.

fileLineIndex FileLineIndex

The file line index.

boundStepIndex int

The step index at the boundary.

Begin(string, BoundSelector)

Marks the beginning of a step section with the specified key.

public void Begin(string key, BoundSelector beginMark)

Parameters

key string

The key identifying the step section.

beginMark BoundSelector

The bound selector marking the beginning.

Clear()

Clears all unclosed sections and bound selector bundles.

public void Clear()

End(string, BoundAnchorMode, IStepShift, FileLineIndex, int)

Marks the end of a step section with the specified key and parameters.

public void End(string key, BoundAnchorMode anchorMode, IStepShift shift, FileLineIndex fileLineIndex, int boundStepIndex)

Parameters

key string

The key identifying the step section.

anchorMode BoundAnchorMode

The anchor mode for the bound.

shift IStepShift

The step shift to apply.

fileLineIndex FileLineIndex

The file line index.

boundStepIndex int

The step index at the boundary.

End(string, BoundSelector)

Marks the end of a step section with the specified key.

public void End(string key, BoundSelector endMark)

Parameters

key string

The key identifying the step section.

endMark BoundSelector

The bound selector marking the end.

GetKeyToStepSectionDictionary(ClStrip)

Gets a dictionary mapping keys to their corresponding step section ranges in the CL strip.

public Dictionary<string, Range<int>> GetKeyToStepSectionDictionary(ClStrip clStrip)

Parameters

clStrip ClStrip

The CL strip containing the steps.

Returns

Dictionary<string, Range<int>>

A dictionary mapping keys to step section ranges.

GetStepSection(string, ClStrip)

Gets the step section range for the specified key in the CL strip.

public Range<int> GetStepSection(string key, ClStrip clStrip)

Parameters

key string

The key identifying the step section.

clStrip ClStrip

The CL strip containing the steps.

Returns

Range<int>

The step section range, or null if the key is not found.

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.