Source/NFX/Environment/ConfigNode.cs
/// <summary>
/// Tries to get value as specified type or throws if it can not be converted
/// </summary>
Tries to get value as specified type or throws if it can not be converted
Tries to get value as specified type or throws if it can not be converted
public object ValueAsType(Type tp, bool verbatim = false, bool strict = true)
              {
                try
                {
                  var val = verbatim ? VerbatimValue : Value;
                  return val.AsType(tp, strict);
                }
                catch(Exception error)
                {
                  throw new ConfigException(string.Format(StringConsts.CONFIGURATION_VALUE_COULD_NOT_BE_GOTTEN_AS_TYPE_ERROR, this.Name, tp.FullName), error);
                }
              }
public object ValueAsType ( Type tp , bool verbatim = false , bool strict = true ) { try { var val = verbatim ? VerbatimValue : Value ; return val . AsType ( tp , strict ) ; } catch ( Exception error ) { throw new ConfigException ( string . Format ( StringConsts . CONFIGURATION_VALUE_COULD_NOT_BE_GOTTEN_AS_TYPE_ERROR , this . Name , tp . FullName ) , error ) ; } }
Tries to get value as specified type or throws if it can not be converted
Tries to get value as specified type or throws if it can not be converted
tp
Type
verbatim
bool
strict
bool