Class ScriptRenameBridge
- Namespace
- Hi.MachiningProcs
- Assembly
- HiMech.dll
Internal Use Only.
Keeps session scripts compiling after a type they name is renamed.
Apply(string) puts a using alias from each former type name to
its current type in front of the script source. Every place that compiles a
session script applies it: ScriptCommand, the C# line embedded in an
NC program (MachiningActRunner), and the webservice's compile
check and completion, so a script compiles the same way in each.
public static class ScriptRenameBridge
- Inheritance
-
ScriptRenameBridge
- Inherited Members
Remarks
Only the name before the last rename is bridged, and only where a script
names the type by its simple name in its own text: a fully qualified old
name, an old name inside the script's own using directives, and a
file pulled in by #load are not bridged.
Fields
UsingAliasLines
One using alias line per renamed or folded type, from the former name to
the current type: MillingPhysicsBrief (renamed to MillingForceBrief),
SeqPhysicsBrief (renamed to SeqPhysicsState, 2026-10-27) and
MillingInstance (folded into MachiningStep, whose [Obsolete]
MillingInstance member answers the step itself, so a script that declared a
variable of the former type still compiles).
public const string UsingAliasLines = "using MillingPhysicsBrief = Hi.MillingForces.MillingForceBrief;\nusing SeqPhysicsBrief = Hi.Physics.SeqPhysicsState;\nusing MillingInstance = Hi.MachiningSteps.MachiningStep;\n"
Field Value
Methods
Apply(string)
Returns scriptText with UsingAliasLines
inserted after what must stay ahead of any using — the
#r, #load, #!, #define and #undef
directives before the script's first token, and its extern alias
lines — followed by a #line directive so diagnostics keep the
script's own line numbers.
public static string Apply(string scriptText)
Parameters
scriptTextstringThe script source; null reads as empty.
Returns
- string
The script source to compile.