Centroid.Config.TryConvert C# (CSharp) Method

TryConvert() public method

public TryConvert ( ConvertBinder binder, object &result ) : bool
binder System.Dynamic.ConvertBinder
result object
return bool
        public override bool TryConvert(ConvertBinder binder, out object result)
        {
            if (binder.Type == typeof (string))
            {
                result = ToString();
                return true;
            }

            try
            {
                result = Convert.ChangeType(RawConfig, binder.Type);
                return true;
            }
            catch (InvalidCastException)
            {
                return base.TryConvert(binder, out result);
            }
        }