-
Notifications
You must be signed in to change notification settings - Fork 16
IsExtensionMethod
Severity - Fail
Check method - Here
The IsExtensionMethod
check makes sure that an engine method within a query, modify, or convert class is classed as an extension method to the first object type. Extension methods are made by using the this
keyword prior to the declaration of the first input parameter. If a method does not take any inputs to operate, then it is exempt from this check.
For example, the following method declaration will fail this check, because it is missing the this
keyword before the first object:
public static bool MethodIsValid(Panel myPanel, Opening myOpening)
{
return false;
}
Whereas this method will pass the check, because the first parameter contains the this
keyword to make the method an extension method.
public static bool MethodIsValid(this Panel myPanel, Opening myOpening)
{
return false;
}
Methods within the Compute and Create classes are exempt from this check.
Files contained within an Engines Objects
folder are exempt from this check (e.g. files with the file path Your_Toolkit/Toolkit_Engine/Objects/Foo.cs
will be exempt).
-
Introduction to the BHoM:
What is the BHoM for?
Structure of the BHoM
Technical Philosophy of the BHoM -
Getting Started:
Installing the BHoM
Using the BHoM
Submitting an Issue
Getting started for developers -
Use GitHub & Visual Studio:
Using the SCRUM Board
Resolving an Issue
Avoiding Conflicts
Creating a new Repository
Using Visual Studio
Using Visual Studio Code -
Contribute:
The oM
The Engine
The Adapter
The Toolkit
The UI
The Tests -
Guidelines:
Unit convention
Geometry
BHoM_Engine Classes
The IImmutable Interface
Handling Exceptional Events
BHoM Structural Conventions
BHoM View Quality Conventions
Code Versioning
Wiki Style
Coding Style
Null Handling
Code Attributes
Creating Icons
Changelog
Releases and Versioning
Open Sourcing Procedure
Dataset guidelines -
Foundational Interfaces:
IElement Required Extension Methods -
Continuous Integration:
Introduction
Check-PR-Builds
Check-Core
Check-Installer -
Code Compliance:
Compliance -
Further Reading:
FAQ
Structural Adapters
Mongo_Toolkit
Socket_Toolkit