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
Properties
XName
Name for XML IO.
public static string XName { get; }
Property Value
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
stringThe key identifying the step section.
anchorMode
BoundAnchorModeThe anchor mode for the bound.
shift
IStepShiftThe step shift to apply.
fileLineIndex
FileLineIndexThe file line index.
boundStepIndex
intThe 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
stringThe key identifying the step section.
beginMark
BoundSelectorThe 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
stringThe key identifying the step section.
anchorMode
BoundAnchorModeThe anchor mode for the bound.
shift
IStepShiftThe step shift to apply.
fileLineIndex
FileLineIndexThe file line index.
boundStepIndex
intThe 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
stringThe key identifying the step section.
endMark
BoundSelectorThe 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
ClStripThe 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
Returns
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
stringThe base directory for resolving relative paths
relFile
stringThe 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.