user11039
user11039

Reputation: 864

Workflow RuleSetDialog

Can we somehow extend the RuleSetDialog class and host in our windows application?

Upvotes: 2

Views: 1594

Answers (3)

Nicolai Ustinov
Nicolai Ustinov

Reputation: 541

You can do that completely via a little bit of hack only : separate the intellisense textbox internal control from the System.Workflow.Activities.Rules.Design namespace ... then you can do almost anything with that. Separation means here the usual : create a wrapper (adapter precisely perhaps a Textbox control), instantiate after resolving some dependencies too (worst case you can just hide the original rule editor, parser, etc...).

Upvotes: 0

Mel
Mel

Reputation: 2385

While it's true that extending the dialog isn't exactly supported, you can get away with some customizations. On a previous project, I was able to hide and rearrange some of the dialog controls at runtime.

var dialog = new RuleSetDialog(activityType, null, ruleset);
dialog.Controls["headerTextLabel"].Visible = false;
dialog.Controls["pictureBoxHeader"].Visible = false;

...

var ruleGroupBox = dialog.Controls["ruleGroupBox"];
ruleGroupbox.Top -= 46;

... etc.

Fire up Reflector and poke around. There's nothing that stops you from hiding and moving the controls to customize it. You could even add controls to the group boxes, rewire the button handlers, or completely rearrange the form to your liking. It's a bit manual, but it can be done.

Upvotes: -1

Related Questions