Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expose UnaryExpressionHelpers and BinaryExpressionHelpers#290

Open
TheBrambleShark wants to merge 2 commits intoUiPath:develop from
TheBrambleShark:Fix288
Open

Expose UnaryExpressionHelpers and BinaryExpressionHelpers #290
TheBrambleShark wants to merge 2 commits intoUiPath:develop from
TheBrambleShark:Fix288

Conversation

@TheBrambleShark
Copy link
Contributor

@TheBrambleShark TheBrambleShark commented Nov 16, 2023
edited
Loading

Also promotes my Increment/Decrement and AddAssign/SubtractAssign expressions.

My added expressions are fully documented and ready for NET7. IfDefs can be removed if this is not desired.

Code also assumes a nullable context. I invite discussion on whether to remove nullable annotations or whether to enable nullable. I personally find it is more clear to the developer but this can be removed if requested.

All of these expressions expect numeric types (with appropriate constraints in Net7). In net6, theoretically any type would be allowed, but non-numeric types will throw. This is by design. The expressions simply provide activities for common C# operations.

Increment = number++
Decrement = number--
AddAssign = number += otherNumber
SubtractAssign = number -= otherNumber

If anyone knows how to add the designer files for these activities, please do let me know. I have been unable to figure out how to do this in Net6 and newer as PresentationCore does not seem to have been ported.

Edit: Fixes #288

Copy link
Collaborator

@aoltean16 aoltean16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increment and Decrement do seem like a good idea, but the other two can be incorporated in the fist 2, if you add increment / decrement step value as another parameter, with default of 1

Copy link
Contributor Author

This is true, but number = number + 1 feels a bit awkward especially when we have support in the language for other operators.

Additionally, exposing these types as suggested will allow third party developers to contribute additional operators in the future. For example, I like working with nullable enabled, so having nullableValue ??= foo wrapped as an activity would be extremely valuable. Currently I have to do this as an if not null then assign, which doubles the amount of work I have to do for what should be a simple operation.

The IDE should make development easier, not harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aoltean16 aoltean16 aoltean16 left review comments

@gabriela-lungu-uip gabriela-lungu-uip Awaiting requested review from gabriela-lungu-uip

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Expose *ExpressionHelpers

AltStyle によって変換されたページ (->オリジナル) /