private string GetCurrentTypeName(Type rootTargetType) { string type = string.Empty; if (_delvePathList.Count > 0) { ISkipDelve skipDelve = _delvePathList[_delvePathList.Count - 1].Value as ISkipDelve; if (skipDelve != null && skipDelve.NextValue != null && skipDelve.NextValueType != null) { return(skipDelve.NextValueType.ToString()); //we want to make this "future friendly", so we take into account that the string value of the property type may change. } else if (_delvePathList[_delvePathList.Count - 1].Value != null) { object val = _delvePathList[_delvePathList.Count - 1].Value; type = val.GetType().ToString() + " \"" + val.ToString() + "\""; } else { type = _delvePathList[_delvePathList.Count - 1].PropertyType.ToString(); } } else if (_delvePathList.Count == 0) { type = rootTargetType.FullName + " \"" + this.RootTarget.ToString() + "\""; } return(type); }
private object GetRealTarget(object target) { ISkipDelve skipDelve = target as ISkipDelve; if (skipDelve != null) { return(skipDelve.NextValue); } return(target); }