Skip to content

Commit

Permalink
feat: Remove preprocessor directives from all files
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebz committed Jan 4, 2024
1 parent 601b4fc commit 9d728ef
Show file tree
Hide file tree
Showing 22 changed files with 274 additions and 329 deletions.
2 changes: 0 additions & 2 deletions Ndapi/Alert.cs
Expand Up @@ -203,7 +203,6 @@ public string Title
set => SetStringProperty(NdapiConstant.D2FP_TITLE, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
Expand All @@ -213,5 +212,4 @@ public bool IsWhiteOnBlack
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}
#endif
}
18 changes: 8 additions & 10 deletions Ndapi/AttachedLibrary.cs
Expand Up @@ -16,11 +16,10 @@ public class AttachedLibrary : NdapiObject<AttachedLibrary>
/// <param name="location">Library location.</param>
public AttachedLibrary(FormModule module, string location)
{
#if FORMS_6
var status = NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, false, location);
#else
var status = NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, location);
#endif
var status = NdapiContext.BuilderVersion.MajorVersion == 6
? NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, false, location)
: NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, location);

Ensure.Success(status);
}

Expand All @@ -31,11 +30,10 @@ public AttachedLibrary(FormModule module, string location)
/// <param name="location">Library location.</param>
public AttachedLibrary(MenuModule module, string location)
{
#if FORMS_6
var status = NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, false, location);
#else
var status = NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, location);
#endif
var status = NdapiContext.BuilderVersion.MajorVersion == 6
? NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, false, location)
: NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, location);

Ensure.Success(status);
}

Expand Down
62 changes: 27 additions & 35 deletions Ndapi/Block.cs
Expand Up @@ -41,17 +41,15 @@ public string BackgroundColor
set => SetStringProperty(NdapiConstant.D2FP_BACK_COLOR, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets the description.
/// </summary>
[Property(NdapiConstant.D2FP_BLK_DESCRIPTION)]
public string Description
{
get => GetStringProperty(NdapiConstant.D2FP_BLK_DESCRIPTION);
set => SetStringProperty(NdapiConstant.D2FP_BLK_DESCRIPTION, value);
}
#endif
/// <summary>
/// Gets or sets the description.
/// </summary>
[Property(NdapiConstant.D2FP_BLK_DESCRIPTION)]
public string Description
{
get => GetStringProperty(NdapiConstant.D2FP_BLK_DESCRIPTION);
set => SetStringProperty(NdapiConstant.D2FP_BLK_DESCRIPTION, value);
}

/// <summary>
/// Gets or sets the comment.
Expand Down Expand Up @@ -278,17 +276,15 @@ public string LockProcedureName
set => SetStringProperty(NdapiConstant.D2FP_LOCK_PROC_NAM, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets whether the block should be listed in the block menu.
/// </summary>
[Property(NdapiConstant.D2FP_LST_IN_BLK_MNU)]
public bool IsListedInBlockMenu
{
get => GetBooleanProperty(NdapiConstant.D2FP_LST_IN_BLK_MNU);
set => SetBooleanProperty(NdapiConstant.D2FP_LST_IN_BLK_MNU, value);
}
#endif
/// <summary>
/// Gets or sets whether the block should be listed in the block menu.
/// </summary>
[Property(NdapiConstant.D2FP_LST_IN_BLK_MNU)]
public bool IsListedInBlockMenu
{
get => GetBooleanProperty(NdapiConstant.D2FP_LST_IN_BLK_MNU);
set => SetBooleanProperty(NdapiConstant.D2FP_LST_IN_BLK_MNU, value);
}

/// <summary>
/// Gets or sets the timeout to abort a query.
Expand Down Expand Up @@ -615,19 +611,16 @@ public string WhereClause
set => SetStringProperty(NdapiConstant.D2FP_WHERE_CLAUSE, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}
#endif
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}

#if FORMS_12_OR_GREATER
/// <summary>
/// Gets or sets the row banding frequency. When row banding is set, every n-th instance of
/// the record would appear in a different background color.
Expand All @@ -638,7 +631,6 @@ public int RowBandingFrequency
get => GetNumberProperty(NdapiConstant.D2FP_ROW_BANDING_FREQ);
set => SetNumberProperty(NdapiConstant.D2FP_ROW_BANDING_FREQ, value);
}
#endif

/// <summary>
/// Gets the delete data source arguments.
Expand Down
22 changes: 9 additions & 13 deletions Ndapi/Canvas.cs
Expand Up @@ -297,17 +297,15 @@ public int ViewportYPositionOnCanvas
set => SetNumberProperty(NdapiConstant.D2FP_VPRT_Y_POS_ON_CNV, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}
#endif
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}

/// <summary>
/// Gets or sets the width.
Expand Down Expand Up @@ -339,7 +337,6 @@ public string WindowName
set => SetStringProperty(NdapiConstant.D2FP_WND_NAM, value);
}

#if FORMS_12_OR_GREATER
/// <summary>
/// Gets or sets the side of the canvas from where the gradient color begins
/// or that there should be no gradient color used.
Expand All @@ -350,7 +347,6 @@ public GradientStartSide GradientStartSide
get => GetNumberProperty<GradientStartSide>(NdapiConstant.D2FP_GRADIENT_START);
set => SetNumberProperty(NdapiConstant.D2FP_GRADIENT_START, value);
}
#endif

/// <summary>
/// Gets all the graphics objects attached to the canvas.
Expand Down
20 changes: 9 additions & 11 deletions Ndapi/Editor.cs
Expand Up @@ -182,17 +182,15 @@ public string VisualAttributeName
set => SetStringProperty(NdapiConstant.D2FP_VAT_NAM, value);
}

#if FORMS_6
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}
#endif
/// <summary>
/// Gets or sets the white-on-black property.
/// </summary>
[Property(NdapiConstant.D2FP_WHITE_ON_BLACK)]
public bool IsWhiteOnBlack
{
get => GetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK);
set => SetBooleanProperty(NdapiConstant.D2FP_WHITE_ON_BLACK, value);
}

/// <summary>
/// Gets or sets the width.
Expand Down
2 changes: 0 additions & 2 deletions Ndapi/Enums/NdapiEnums.cs
Expand Up @@ -86,10 +86,8 @@ public enum DataSourceColumnType
Blob = NdapiConstant.D2FC_DSTY_BLOB,
Clob = NdapiConstant.D2FC_DSTY_CLOB,
Bfile = NdapiConstant.D2FC_DSTY_BFILE,
#if FORMS_6
Cfile = NdapiConstant.D2FC_DSTY_CFILE,
Unknown = NdapiConstant.D2FC_DSTY_UNKNOWN
#endif
}

public enum CommunicationMode
Expand Down
12 changes: 4 additions & 8 deletions Ndapi/Enums/ObjectType.cs
Expand Up @@ -62,12 +62,10 @@ public enum ObjectType
/// </summary>
Editor = NdapiConstant.D2FFO_EDITOR,

#if FORMS_12_OR_GREATER
/// <summary>
/// Event.
/// </summary>
Event = NdapiConstant.D2FFO_EVENT,
#endif

/// <summary>
/// Font declaration.
Expand Down Expand Up @@ -129,12 +127,10 @@ public enum ObjectType
/// </summary>
MenuModule = NdapiConstant.D2FFO_MENU_MODULE,

#if FORMS_6
/// <summary>
/// Menu module parameter.
/// </summary>
MenuParameter = NdapiConstant.D2FFO_MENU_PARAM,
#endif
/// <summary>
/// Menu module parameter.
/// </summary>
MenuParameter = NdapiConstant.D2FFO_MENU_PARAM,

/// <summary>
/// Object group.
Expand Down
4 changes: 1 addition & 3 deletions Ndapi/Event.cs
@@ -1,5 +1,4 @@
#if FORMS_12_OR_GREATER
using Ndapi.Core;
using Ndapi.Core;
using Ndapi.Core.Handles;
using Ndapi.Enums;

Expand Down Expand Up @@ -112,4 +111,3 @@ public EventViewMode EventViewMode
set => SetNumberProperty(NdapiConstant.D2FP_EVENT_VIEW_MODE, value);
}
}
#endif

0 comments on commit 9d728ef

Please sign in to comment.