WinForms DCP

In this section, the user can find the current supported controls, helpers, mappers and behaviors from the WinForms platform on your converted web application. Also, the user can understand what is the purpose for several features added in the current emulated platforms. Each project from this package is enumerated and explained.

For a better understanding of this section, we recommend that each user first visit and read the section DCP: Desktop Compatibly Platform

Mobilize.Web.BundleBasic

In this project, the user can find the web support definition of controls, utilities, components and helpers from the original WinForms platforms such as a Button, TextBox or ComboBox. Also, you can find helpers created by Mobilize to support functionalities from the previously mentioned platform, such as commands and observable wrappers.

The following list enumerates the current supported controls from WinForms platforms on this project:

BindingNavigator

Button

ButtonBase

CheckBox

CheckedListBox

ComboBox

ContainerControl

ContextMenuStrip

Control

DataGridView

DateTimePicker

Form

GroupBox

ImageList

Label

LinkLabel

ListBox

ListControl

ListView

MaskedTextBox

MenuStrip

MonthCalendar

NumericUpDown

Panel

PictureBox

ProgressBar

RichTextBox

ScrollableControl

SplitContainer

SplitterPanel

StatusStrip

TabControl

TabPage

TextBox

TextBoxBase

Timer

ToolStrip

ToolStrpButton

ToolStripDropDown

ToolStripDropDownButton

ToolStripItem

ToolStripLabel

ToolStripMenuItem

ToolStripSeparator

ToolStripSplitButton

ToolStripStatusLabel

ToolStripTextBox

ToolTip

TrackBar

TreeNode

TreeView

UpDownBase

UserControl

Web Browser

Is important to mention, that the previous list contains a support for several controls from WinForms platform, but some features are still in progress or not supported. If you want to support some new feature, please follow our recommendations and guidelines. See more at Create an Observable Object

Client Commands: some cases, the Back-End needs a specific action to be executed on the Front-End side. Client Commands creates a response from the Back-End side where you can specify what should be execute on your web application (Front-End side). The following cases are implemented:

  • Change Focus Command: indicates which control should be focused after the request is finished.

  • Download File Command: allows to download a file from a specific URL.

  • Open External Url: redirects to a specific URL in a new browser tab.

  • Quit Current Application Command: closes the current application.

For each client command, it is necessary the respective implementation on the Front-End side, therefore, in addition of queueing the command, you need a specific Front End behavior to be registered. See more at Component maintenance

Commands: as part of the communication between the Front-End and Back-End, there exist commands specifying a requested action from the Front-End side. Each command is evaluated from the HTTP request and executes changes over the Backend. The next list indicates the current implemented commands:

  • Action Command: a System.Action delegate can be registered and retrieved to be executed from Front-End side.

  • Application Refresh Command: prepares the backend storage to be refreshed and re-send all existing controls to the Front-End side because a browser reload was requested, therefore, a new rendering should be executed.

  • Application Start Command: executes the initialization of a new application, the entry point should be invoked.

  • Application Terminate Command: cleans the current application and remove all object from the storage.

  • Background Worker Started Command: initializes the current hub from Signal R in order to start executing task on the background.

  • Background Worker Finished Command: finishes the execution on the background of any task.

  • Event Command: executes specific event handler indicated from the Front-End, over Control on the Back-End side.

Observable Wrappers: for objects implemented for third party and defined without the Observable attribute, we can create the Observable Wrapper in order to simulate the tracking behavior of an observable on those objects. For the moment, we have the following wrappers:

ArrayList

Array

BackgroundWorker

BuiltInTypes

ClearItemEventHandler

Connection

DataColumn

DataRowView

DataRow

DataSet

DataTable

DataTable

DataView

Dictionary

EnumTypes

EventHandler

GenericDataSet

GenericDataTable

HashTable

ItemEventHandler

ListViewItemClickActionEventHandler

List

MultidimensionalArray

OpenCloseEvent

OrderedDictionary

Queue

ResourceManager

RunWorkerCompletedEventArgs

SortedListGeneric

SortedList

SortedListGeneric

StringWriter

TypeObservable

TypeValidationEventHandler

Other Features:

  • ByRef Feature: it is used to wrap an instance of any type in order to be modified by reference. When you modify the wrapped instance, another reference must be affected. The main reason of the feature is support references when your instance is stored on a property from another object.

  • Background Worker Feature: enables to execute tasks on the background while your application is running. Background worker creates a new thread on the server that exist even when your http request is done. When your task is finished, the server will send a message to the Front End, in order to refresh any change after the execution. It’s important to mention that we are using sockets as the communication library on this feature and for the moment it is the only feature using sockets.

  • Componentized controls Feature: by using this feature enables to WebMap runtime configuration to identify which controls were created on design time and which ones were added during the runtime. It is very useful when there are many container controls as TabPage, Panel, because reduces the number of data to be synchronized between Back-End and Front-End.

  • Structs Feature: tracking values between Front-End and Back-End from struct is not possible, in order to support this behavior, structs are converted to classes, therefore Structs feature enable to you to track values from the new class and emulated the cloning behavior as a Struct does.

  • Binding Source Feature: allows a control to link the value of a property with an object stored in a List or DataSource. It means if you modify any of the two side of the binding, the other hand must be affected. One important characteristic, with the binding source, you can condition the automatic assignment of any of both side by manually.

Mobilize.Web.BundleBasic.DTO

This project defines mappers, controllers and DTOs required to synchronize controls models defined in the project Mobilize.Web.BundleBasic with the corresponding component on the Front End side.

By default, each class that inherits from Mobilize.Web.Control, automatically will be mapped and each Intercepted property will be sent to the Front-End side. But if you want to select what should be sent to the Front End, a special mapper should be defined, the following classes define custom mappers for the given controls:

BindingNavigatorMapper

ButtonBaseMapper

ButtonMapper

CheckBoxMapper

CheckedListBoxMapper

ColorDialogMapper

ComboBoxMapper

ContextMenuStripMapper

ControlMapper

DataGridViewMapper

DataTimePickerMapper

FormMapper

GroupBoxMapper

IconMapper

InputBoxMapper

LabelMapper

LinkLabelMapper

ListBoxMapper

ListControlMapper

ListViewMapper

MaskedTextBoxMapper

MenuStripMapper

MessageBoxMapper

MonthalendarMapper

NotificationIconMapper

NumericUpDownMapper

OpenFileDialogMapper

PanelMapper

PictureBoxMapper

PrintDialogMapper

ProgressBarMapper

RadioButtonMapper

RichTextBoxMapper

ScrollableControlMapper

SplitContainerMapper

SplitterPanelMapper

StatusStripMapper

TabControlMapper

TableLayoutPanelMapper

TabPageMapper

TextBoxBaseMapper

ThreadExceptionDialogMapper

TimerMaper

ToolStripButtonMapper

ToolStripComboBoxMapper

ToolStripDropDownButtonMapper

ToolStripDropDownItemMapper

ToolStripDropDownMenuMapper

ToolStripMapper

ToolStripLabelMapper

ToolStripMenuItemMapper

ToolStripSeparatorMapper

ToolStripSplitButtonMapper

ToolStripStatusLabelMapper

ToolStripTextBoxMapper

TrackBarMapper

TreeNodeMapper

TreeViewMapper

UpDownBaseMapper

UserControlMapper

WebBrowserMapper

For futher information about how to create a mapper, visit Create Mappers

Mobilize.Web.BundleVBUC

If you are converting your original source code is not coming directly from WinForms, but rather it needs to be converted from another language (typically VB6) to C#, in order to be able to be converted into a WebMap application, there exist controls supported by mobilize on the first jump. In order to emulate the behavior of these controls and helpers from VBUC are defined on this project, therefore, the web behavior from an Upgrade Helper is implemented.

The following controls and helpers are supported: DataControlHelper, ADODataControlHelper, DAODataControlHelper, DataGridViewFlex and ShapeHelper.

Mobilize.Web.BundleVBUC.DTO

This project defines mappers, controllers and DTOs required to synchronized controls models defined in the project Mobilize.Web.BundleVBUC with the corresponding component on the Front End side.

Existing mapper for the previous project: AdoDataControlMapper, DaoDataControlHelperMapper, FlexGridMapper and ShapeHelperMapper.

Mobilize.Web.BundleUtils

Bundle Utils defines custom helper from mobilize to support controls or libraries from WinForms platforms on a web environment. These utils are added during the conversion process by using a modern detection mechanism in order to replace avoiding manual work after the conversion.

Setting the NuGet Packages Sources

In the migrated application, you can use pre-released versions of the above projects to test new functionality.

Steps to add necessary sources:

  • In the migrated app, right-click the solution and go to Manage NuGet Packages for solution.

  • In the Nuget - Solution click the settings wheel.

  • After that, go to NuGet Package Manager > Package Sources and click the add button.

  • Write the Name and the Link of the source to add and click the Update button.

  • When you are done adding new sources click the Ok button.

  • You can now search for a package and you will see all the available versions. Make sure you have the "Include prerelease" option selected.

Last updated