public static string ToNative(this SpecklePoint inputObject)
        {
            var convertedObject = new StructuralNode();

            foreach (var p in convertedObject.GetType().GetProperties().Where(p => p.CanWrite))
            {
                var inputProperty = inputObject.GetType().GetProperty(p.Name);
                if (inputProperty != null)
                {
                    p.SetValue(convertedObject, inputProperty.GetValue(inputObject));
                }
            }

            return(convertedObject.ToNative());
        }
Beispiel #2
0
    public static string ToNative(this SpecklePoint inputObject)
    {
      return SchemaConversion.Helper.ToNativeTryCatch(inputObject, () =>
      {
        var convertedObject = new StructuralNode();

        foreach (var p in convertedObject.GetType().GetProperties().Where(p => p.CanWrite))
        {
          var inputProperty = inputObject.GetType().GetProperty(p.Name);
          if (inputProperty != null)
            p.SetValue(convertedObject, inputProperty.GetValue(inputObject));
        }

        return convertedObject.ToNative();
      });
    }