public StepValue <TParent> GetParent <TParent>() { IStepValue stepValue = this; while (stepValue.Parent != null) { if (stepValue.Parent is StepValue <TParent> ) { return((StepValue <TParent>)stepValue.Parent); } stepValue = stepValue.Parent; } return(null); }
public StepValue(TValue value, IStepValue parent) { this.Value = value; this.Parent = parent; this.TypeValue = typeof(TValue); }