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, IProgress<IMessage>)
Ctor.
public BoundSelectorHost(XElement src, string baseDirectory, IProgress<IMessage> progress)
Parameters
srcXElementXML source element
baseDirectorystringBase directory for resolving relative paths
progressIProgress<IMessage>Progress reporter for nested bundle XML.
Properties
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
Begin(string, AnchorMode, IStepShift, FileLineIndex, int)
Marks the beginning of a step section with the specified key and parameters.
public void Begin(string key, AnchorMode anchorMode, IStepShift shift, FileLineIndex fileLineIndex, int boundStepIndex)
Parameters
keystringThe key identifying the step section.
anchorModeAnchorModeThe anchor mode for the bound.
shiftIStepShiftThe step shift to apply.
fileLineIndexFileLineIndexThe file line index.
boundStepIndexintThe step index at the boundary.
Begin(string, BoundSelector)
Marks the beginning of a step section with the specified key. A key begun already and not ended keeps its first begin: the call is ignored (ClearUnclosed() drops the begins a stopped run left, so a replay's begin is not the ignored one).
public void Begin(string key, BoundSelector beginMark)
Parameters
keystringThe key identifying the step section.
beginMarkBoundSelectorThe bound selector marking the beginning.
Clear()
Clears all unclosed sections and bound selector bundles: the runtime reset, which clears the strip the sections select on.
public void Clear()
ClearUnclosed()
Forgets the sections begun and not ended, and keeps the closed ones. A begin belongs to the run that met
its anchor: a run stopped between a key's begin and its end leaves the key open, and kept into the next
run of the session (no runtime reset between them: the player's Stop, then Start) the open begin would
swallow that run's begin of the key (Begin(string, BoundSelector) keeps the first) and
pair with that run's end into a section from the stopped run's begin to the new run's end, across the
positions the stop dropped. The host calls it at the start of every outermost run
(LocalProjectService.BeginNcRunner). The closed sections stand, as the steps they select do; a
second end of a closed key is refused by End(string, BoundSelector) as before.
public void ClearUnclosed()
End(string, AnchorMode, IStepShift, FileLineIndex, int)
Marks the end of a step section with the specified key and parameters.
public void End(string key, AnchorMode anchorMode, IStepShift shift, FileLineIndex fileLineIndex, int boundStepIndex)
Parameters
keystringThe key identifying the step section.
anchorModeAnchorModeThe anchor mode for the bound.
shiftIStepShiftThe step shift to apply.
fileLineIndexFileLineIndexThe file line index.
boundStepIndexintThe 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
keystringThe key identifying the step section.
endMarkBoundSelectorThe 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
clStripClStripThe 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, bool)
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, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
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.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory