Table of Contents

Class ProjectFolderDependency

Namespace
Hi.NcParsers.Dependencys.SystemWired
Assembly
HiMech.dll

Exposes the absolute base directory of the project that owns this runner. Resolved at runtime via BaseDirectoryProvider; the host (e.g. LocalProjectService, a test harness) wires the provider to its known project root after the runner is constructed, because SoftNcRunner itself does not retain the baseDirectory argument it sees during XML deserialization.

Consumed by syntaxes that need to resolve a project-relative path to an absolute file system location — e.g. SubProgramCallSyntax for O<n> subprogram lookup under InternalFolder. Reading FilePath is not a substitute: that path is relative and resolving it via Path.GetFullPath would anchor against the process working directory, not the project root.

public class ProjectFolderDependency : INcDependency, IMakeXmlSource
Inheritance
ProjectFolderDependency
Implements
Inherited Members
Extension Methods

Constructors

ProjectFolderDependency()

Initializes a new instance with no BaseDirectoryProvider; the host assigns one before queries.

public ProjectFolderDependency()

ProjectFolderDependency(Func<string>)

Initializes a new instance with the given BaseDirectoryProvider.

public ProjectFolderDependency(Func<string> provider)

Parameters

provider Func<string>

Delegate that resolves the absolute base directory at lookup time.

Properties

BaseDirectory

The live absolute base directory, or null when BaseDirectoryProvider is unset or returns null.

public string BaseDirectory { get; }

Property Value

string

BaseDirectoryProvider

Runtime provider for the absolute project base directory. Public so cross-assembly hosts (e.g. LocalProjectService in HiNc) can wire it after the runner is constructed — same host-wired posture as KinematicsProvider. Null provider or null return means the host has not configured a base directory yet — consumers should treat this as a configuration error and surface a diagnostic rather than silently falling back.

public Func<string> BaseDirectoryProvider { get; set; }

Property Value

Func<string>

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

MakeXmlSource(string, string, bool)

Runtime-only dependency — the BaseDirectoryProvider is wired per-host and is not meaningful to persist; serialization writes only the empty element so the dependency survives an XML round-trip.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string
relFile string
exhibitionOnly bool

Returns

XElement

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

factory XFactory