MemberPath
- Namespace: Turian.Engine.UI
- Source File: MemberPath.cs
Reads and writes a dotted a.b.c member path on an object graph by reflection.
Public Methods
Read
public static object? Read(object? root, string path)
Reads path starting at root, or null if any step is missing.
Parameters:
root(object?): The object the path is relative to.path(string): A dotted member path; an empty path returnsroot.
Returns: object?
TryWrite
public static bool TryWrite(object? root, string path, object? value)
Writes value to the last segment of path.
Parameters:
root(object?): The object the path is relative to.path(string): A dotted member path with at least one segment.value(object?): The value to assign; converted to the target member type when possible.
Returns: bool
truewhen the assignment succeeded.