FastQuant.ProviderPropertyList.GetStringValue C# (CSharp) Méthode

GetStringValue() public méthode

public GetStringValue ( string name, string defaultValue ) : string
name string
defaultValue string
Résultat string
        public string GetStringValue(string name, string defaultValue)
        {
            string s;
            return _properties.TryGetValue(name, out s) ? s : defaultValue;
        }

Usage Example

Exemple #1
0
 protected internal virtual void SetProperties(ProviderPropertyList properties)
 {
     foreach (var p in GetType().GetProperties().Where(p => p.CanRead && p.CanWrite))
     {
         var converter = TypeDescriptor.GetConverter(p.PropertyType);
         if (converter.CanConvertFrom(typeof(string)))
         {
             var value = properties.GetStringValue(p.Name, null);
             //if (value != null && converter.IsValid(value))
             if (value != null)
             {
                 p.SetValue(this, converter.ConvertFromInvariantString(value), null);
             }
         }
     }
 }
All Usage Examples Of FastQuant.ProviderPropertyList::GetStringValue