Skip to content

Commit

Permalink
feat: Use NdapiConstant for property parameter in more methods of Nda…
Browse files Browse the repository at this point in the history
…piObject
  • Loading branch information
felipebz committed Jan 4, 2024
1 parent 92db02c commit 5f0de4e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Ndapi/NdapiObject.cs
Expand Up @@ -383,17 +383,17 @@ 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));
}

/// <summary>
/// Checks whether the property has its default value.
/// </summary>
/// <param name="property">Property id.</param>
/// <returns>A boolean indicating whether property has its default value. If the object doesn't have the property, returns false.</returns>
public bool HasDefaultedProperty(int property)
public bool HasDefaultedProperty(NdapiConstant property)
{
var status = IsPropertyDefaulted(property);
if (status == D2fErrorCode.D2FS_DONTHAVE)
Expand All @@ -410,7 +410,7 @@ public bool HasDefaultedProperty(int property)
/// </summary>
/// <param name="property">Property id.</param>
/// <returns>A boolean indicating whether property value was overriden. If the object doesn't have the property, returns false.</returns>
public bool HasOverriddenProperty(int property)
public bool HasOverriddenProperty(NdapiConstant property)
{
var status = IsPropertyDefaulted(property);
if (status == D2fErrorCode.D2FS_DONTHAVE)
Expand All @@ -427,9 +427,9 @@ public bool HasOverriddenProperty(int property)
/// </summary>
/// <param name="property">Property id.</param>
/// <returns>A boolean indicating whether property was inherited.</returns>
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;
Expand All @@ -440,7 +440,7 @@ public bool HasInheritedProperty(int property)
/// </summary>
/// <param name="property">Property id.</param>
/// <returns>The property state.</returns>
public PropertyState GetPropertyState(int property)
public PropertyState GetPropertyState(NdapiConstant property)
{
PropertyState state;
if (HasInheritedProperty(property))
Expand Down

0 comments on commit 5f0de4e

Please sign in to comment.