Extending existing activity designers - c#

I am looking to create a custom activity which is essentially the same as the 'If' activity but would like to add an extra button to the designer (just above the Condition expression text box). Does anyone know if this is even possible or would I have to create a brand new custom activity (along with a new designer) with all the same functionality as the 'If' one but with my extra bits added?
Thank you for your time.
Regards,
Michael

Depends if you are rehosting the designer or want to use the functionality in VS. With a rehosted desogner there are several ways to update the UI of existing activities like using WPF adorners
See Visual Workflow Tracking for an example.

Related

easy way to replace components in visual studio C#

I made a GUI using C# for my project using default buttons, graphs and other components available in visual studio. Now I have installed DotNetBar for cool components like tabs buttons etc and want to replace them with the old ones. Is there an easy way to do that so that just replacing (for example a button) associates the code with the newly added button...?
Thanks in advance
No, as much as I know there is no easy way unless the producer of the new controls provides an automated tool for the job.
The main reason lies in the difference in property names, methods name and above all the event handler signature between the standard controls and the new ones. You could be lucky if the third party controls have the same properties, methods and events of the standard one, but usually they have implemented new functionality and extendend the base one and this usually causes broad incompatibility.
Then there is the need to manually edit every project file to substitute the references from the standard controls to the new ones and this is also a complex work that only the producer of the control could resolve

Why is my workflow not showing all the steps?

I created a workflow in Microsoft Dynamics CRM 2011 which I then exported and opened the XAML file with VS 2010. It shows me this when I open it:
But there are actually many more steps in this workflow. Why can't I see them or edit them? I tried clicking Expand All at the top right, but that didn't seem to make any difference. If I look at the actual code I can see the numerous steps - but no in the design view. Any ideas why?
The activities in your screenshot are custom activities. By default all you see is this placeholder. You can however create custom activity designers and associate the activities with those. In your custom activity designer you can do anything you can do in WPF including showing the child activities.

Editing custom workflows with Workflow Re-hosting

I've been prototyping this Workflow editor for end users and I've based my source from [MSDN]http://msdn.microsoft.com/en-us/library/aa480213.aspx. So far, I've made the following tweaks:
I've added a new project called Workflow.Core which will house custom activities and default workflows.
The toolbox now shows custom activities that are included in Workflow.Core.
On load, the workflow designer will show a default workflow from Workflow.Core instead of an empty SequentialWorkflowActivity. Aside from defining the initial flow of activities, the default workflow contains properties that are set and modified during workflow runtime.
The problem is that WorkflowView wont let me edit the default workflow. It's like it's in read-only mode, although I can still edit its attributes. It worked fine when I was loading an instance of SequentialWorkflowActivity.
Then I tried adding the default workflow's activities to an instance of SequentialWorkflowActivity and load that instead. It worked. I was able to drag new activities onto it and make property changes. But in doing so, the referenced properties within the default workflow are no longer available.
There is an alternative: that I make and include an activity to house all properties instead of the default workflow itself. It, however, will need explaining to the client (whom I don't think will understand) why there's an omnipresent activity in all their custom workflows which does no discernible business logic.
In summary, I need to make workflow designer edit the default workflows. So if you guys have any ideas or suggestions, please let me know. I need all the help I can get.
Thanks in advance!
Carlos

Creating a custom menu in .NET WinForms

Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon).
My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortcomings of this solution, such as
the control can only be placed, and displayed within the form;
if the form is too small, some area of the control won't be displayed;
the control also have to be manually shown/hidden.
Thus, I'm looking for a way to display this control outside of the boundaries of the application. Creating a new form would result in title-bar deactivating on display, so that's also out. Alternatively, any other approach to create a customized menu would be very welcomed.
Edit: I don't want to use any commercial products for this; and since it's about a simple menu customization, it's not related to Microsoft's ribbon "research" in any way.
unless you are in the business of providing .net components, you should be looking to buy it off the shelf. Its a lot of work getting such a control right - There are already vendors providing this kind of UI. e.g. ComponentOne
if you are trying to build this component as a product, you should look at the link below. Apparently Microsoft has a 'royalty-free' license around the Office UI to protect their R&D investments. As of now you need to tell them that you are using something similar to the Office UI. More of that here
The MenuStrip class has a Renderer property. You can assign your own ToolStripRenderer derived class to customize the painting. It's a fair amount of work.

What is the best way to create a wizard in C# 2.0?

I have a winforms application where users will be creating stock items, and a time of creation there are a number of different things that need to happen.
I think the UI for this should probably be a wizard of some kind, but I'm unsure as to the best way to achieve this. I have seen a couple of 3rd party Wizard controls, and I have also seen manual implementations of making panel visible/invisible.
What are the best ways that people have used in the past, that are easy to implement, and also make it easy to add "pages" to the wizard later on if needed?
I know this answer has already been accepted, but I just found a better Wizard control that's free, and of course, since it's on CodeProject, includes the source, so you can modify it if it's not exactly what you want. I'm adding this as an answer for the next person to stumble across this question looking for a good Wizard control.
http://www.codeproject.com/KB/miscctrl/DesignTimeWizard.aspx
Here are a few more resources you should check out:
This DevExpress WinForms control: http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/
A home-grown wizards framework: http://weblogs.asp.net/justin_rogers/articles/60155.aspx
A wizard framework by Shawn Wildermut part of the Chris Sells's Genghis framework: http://www.sellsbrothers.com/tools/genghis/
Use a tab-control inside a form.
Change back color to "Control" in all tab-pages.
Set "appearance" to flat buttons to get rid of the white border-stuff.
Hide the tabs by sizing the entire control so that the tabs gets pushed up "under" the title bar of the form. If you need other controls (or banner maybe) above the tab-control, then instead hide the tabs with a panel-control or similar.
Childplay to code logic for back/next buttons and very easy to extend with new pages.
Take a look at this article on MSDN about "inductive user interfaces". It describes a framework (and provides the code to download) based on UserControls that give you "navigation" within a form. Perfect for designing wizards.
The easiest way to create a wizard dialog is to use one of the third-party versions available that handle all of the "hard stuff" (the page navigation, UI framework, etc.) for you. The one I like the most is from Divelements; they have both a WinForms and a WPF version.

Categories

Resources