From 5f0de4e83c4c8ea747b9a5708f96a80fac8ab923 Mon Sep 17 00:00:00 2001 From: Felipe Zorzo Date: Thu, 4 Jan 2024 00:09:57 -0300 Subject: [PATCH] feat: Use NdapiConstant for property parameter in more methods of NdapiObject --- Ndapi/NdapiObject.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ndapi/NdapiObject.cs b/Ndapi/NdapiObject.cs index f694829..8a1020e 100644 --- a/Ndapi/NdapiObject.cs +++ b/Ndapi/NdapiObject.cs @@ -383,9 +383,9 @@ public void InheritProperty(int property) Ensure.Success(status); } - internal D2fErrorCode IsPropertyDefaulted(int property) + internal D2fErrorCode IsPropertyDefaulted(NdapiConstant property) { - return NativeMethods.d2fobid_IspropDefault(NdapiContext.GetContext(), _handle, property); + return NativeMethods.d2fobid_IspropDefault(NdapiContext.GetContext(), _handle, ConstantConverter.GetValue(property)); } /// @@ -393,7 +393,7 @@ internal D2fErrorCode IsPropertyDefaulted(int property) /// /// Property id. /// A boolean indicating whether property has its default value. If the object doesn't have the property, returns false. - public bool HasDefaultedProperty(int property) + public bool HasDefaultedProperty(NdapiConstant property) { var status = IsPropertyDefaulted(property); if (status == D2fErrorCode.D2FS_DONTHAVE) @@ -410,7 +410,7 @@ public bool HasDefaultedProperty(int property) /// /// Property id. /// A boolean indicating whether property value was overriden. If the object doesn't have the property, returns false. - public bool HasOverriddenProperty(int property) + public bool HasOverriddenProperty(NdapiConstant property) { var status = IsPropertyDefaulted(property); if (status == D2fErrorCode.D2FS_DONTHAVE) @@ -427,9 +427,9 @@ public bool HasOverriddenProperty(int property) /// /// Property id. /// A boolean indicating whether property was inherited. - public bool HasInheritedProperty(int property) + public bool HasInheritedProperty(NdapiConstant property) { - var status = NativeMethods.d2fobii_IspropInherited(NdapiContext.GetContext(), _handle, property); + var status = NativeMethods.d2fobii_IspropInherited(NdapiContext.GetContext(), _handle, ConstantConverter.GetValue(property)); Ensure.BooleanResult(status); return status == D2fErrorCode.D2FS_YES; @@ -440,7 +440,7 @@ public bool HasInheritedProperty(int property) /// /// Property id. /// The property state. - public PropertyState GetPropertyState(int property) + public PropertyState GetPropertyState(NdapiConstant property) { PropertyState state; if (HasInheritedProperty(property))