Universe.Modules.Currency.BaseCurrencyConfig.ToOSD C# (CSharp) Method

ToOSD() public method

public ToOSD ( ) : OSDMap
return OSDMap
        public override OSDMap ToOSD ()
        {
            OSDMap returnvalue = new OSDMap ();
            foreach (PropertyInfo propertyInfo in GetType ().GetProperties ()) {
                try {
                    if (propertyInfo.PropertyType.IsAssignableFrom (typeof (float)))
                        returnvalue.Add (propertyInfo.Name, (float)propertyInfo.GetValue (this, new object [0]));
                    else if (propertyInfo.PropertyType.IsAssignableFrom (typeof (int)))
                        returnvalue.Add (propertyInfo.Name, (int)propertyInfo.GetValue (this, new object [0]));
                    else if (propertyInfo.PropertyType.IsAssignableFrom (typeof (bool)))
                        returnvalue.Add (propertyInfo.Name, (bool)propertyInfo.GetValue (this, new object [0]));
                    else if (propertyInfo.PropertyType.IsAssignableFrom (typeof (string)))
                        returnvalue.Add (propertyInfo.Name, (string)propertyInfo.GetValue (this, new object [0]));
                    else if (propertyInfo.PropertyType.IsAssignableFrom (typeof (UUID)))
                        returnvalue.Add (propertyInfo.Name, (UUID)propertyInfo.GetValue (this, new object [0]));
                } catch (Exception ex) {
                    MainConsole.Instance.Warn ("[BaseCurrency]: Exception toOSD() config: " + ex);
                }
            }

            return returnvalue;
        }