private void EnsureWriteCallIsValid <T>() { if (_iterator.CurrentProperty is PlyArrayProperty) { throw ExceptionFactory.GetGotArrayWhenValueExpectedException(_iterator.CurrentProperty); } if (PlyTypeConverter.ToNative(_iterator.CurrentProperty.ValueType) != typeof(T)) { throw ExceptionFactory.GetUnexpectedDataTypeException(_iterator.CurrentProperty, typeof(T)); } }
private void EnsureWriteArrayCallIsValid <T>() { var expected = _iterator.CurrentProperty as PlyArrayProperty; if (expected == null) { throw ExceptionFactory.GetGotValueWhenArrayExpectedException(_iterator.CurrentProperty); } if (PlyTypeConverter.ToNative(expected.ValueType) != typeof(T)) { throw ExceptionFactory.GetUnexpectedDataTypeException(expected, typeof(T)); } }