EntrySet.Extenders
New visual and functional features for old controls.

EntrySet Extenders is set of three components which extend controls on a form with visual features, validation functions and item binding. Just place EntrySet Extenders on a form and all controls will be enriched with new properties and attributes.
ItemBindingExtender, ValidationExtender, VisualExtender
Visual Extender
VisualExtender is a special component, which can extend the functionality of other components about new visual functions. How does it work? You insert VisualExtender into Form and all components, which occur in Form, are extended about new properties, including Form. VisualExtender uses for this function Extender Provider from .NET Framework.
Visual Abilities
VisualExtender distinguishes between two types of components - Containers and Controls. Each type has different visual possibilities.
Containers
Container type components include e.g. Form and Panel. In these components you can insert other components. VisualExtender extendeds Containers with these visual functions.
Background
This function can color the background of component in several different ways. It can also draw a watermark on the component's background, which is created by the mark of graphic font Windings or another font.
Title
This function can display the title and subtitle of the component's background. This can be used e.g. to display the form's name and other supplementary information.

Controls
Other visual components e.g. TextBox, Label and Checkbox. By means of VisualExtender can be Controls extended about these visual functions:
Caption
For description of each component are classically used labels. This function draws next to component Caption without necessity using Label control. Caption can be displayed in several different ways.

Hyperlink
This function displays Caption in style of hyperlink. It means that it is possible to click on hyperlink and cause specific operation.
Required Sign
This function displays Required Sign at data entry component. It means that user has to enter data in this section.
Flag
This function can display so-called Flag next to the component. It is a simple picture (e.g. flag, point, arrow, diamond), which can represent specific condition or information. You can click on the Flag and cause some operation.

Shadow
This function has very simple task - to display a shadow under the component. It can cause an impression of three-dimensional space and reach that way more attractive user interface.
Design-time
VisualExtender was designed to be very easy to work with in design-time. VisualExtender changes appearance of your application and that is why it is important to have possibility seeing all changes immediately. The appearance of application in design-time must be the same as in run-time not to be necessary to compile and initialize the project after each change.
Work with VisualExtender is similar to work in graphic program. For adjusting of the particular visual functions can be used so-called Visual Editors, which look similar as
Tool Box in graphic programs. From the context menu of component you choose e.g. command Captions and Visual Editor for Caption presetting displays.
The properties of visual functions can be also set in classical way with Property Window. Object model of VisualExtender is designed carefully. Properties have logical hierarchical structure, which can be easily understood.
Run-time
Visual function of VisualExtender can be also set in run time by code. According to the fact, that the components are extended with new properties, its settyings are bit more complicated than adjusting at standard component property. If you have ever used ToolTip component this procedure would not be unfamiliar to you. ToolTip also uses Extender Provider.
Following code shows how can be VisibleCaption property set at TextBox:
[Visual Basic]
'create new category describing caption
Dim myCaption As New PureComponents.EntrySet.Extenders.VisualExtender.Caption
'set caption appearance
myCaption.Style.DefaultStyle.BackColor = System.Drawing.Color.Aqua
'Turn on caption and shape diplaying
myCaption.VisibleCaption = True
myCaption.VisibleShape = True
'set textbox caption
VisualExtender1.SetCaption(TextBox1, myCaption)
'set StyleSource property to Local
VisualExtender1.SetStyleSource(TextBox1, PureComponents.EntrySet.Extenders.VisualExtender.StyleSource.Local)
[C#]
//create new category describing
PureComponents.EntrySet.Extenders.VisualExtender.Caption myCaption = new PureComponents.EntrySet.Extenders.VisualExtender.Caption();
//set caption
myCaption.Style.DefaultStyle.BackColor = System.Drawing.Color.Aqua;
//Turn on caption and shape
myCaption.VisibleCaption = true;
myCaption.VisibleShape = true;
//set textbox
VisualExtender1.SetCaption(TextBox1, myCaption);
//set StyleSource property to Local
VisualExtender1.SetStyleSource(TextBox1, PureComponents.EntrySet.Extenders.VisualExtender.StyleSource.Local);
Styles
The appearance of visual functions is set using styles. All visual properties are associated in style. It facilitates its setting. Caption visual function has several styles for different states - default, disabled, focus and hover.

Another important property of styles is StyleSource. This property identifies where the style setting is saved. There are three possibilities - Extender, Parent and Local. If StyleSource = Local, it means that the component has set its own style. That way you can have several TextBoxes on the Form and each of them can have different look. If StyleSource = Parent, it means that the style is saved in Parent component, which must be Container. That means that you can have e.g. several Panels on the Form and each of them contains several TextBoxes. You do not have to set the appearance of each TextBox separately, just set the Style in Panel. All the TextBoxes in such Panel will have common appearance. The last possibility is: StyleSource = Extender. That means that the Style is saved in Extender component and is default setting.
ItemBindingExtender
ItemBindingExtender is component that helps you easily manipulate with controls on data entry forms. Basic principle of ItemBindingExtender is that you work with controls using newly introduced Id ("Company" for example) instead of their instance name (like TextBox1 for exaple). Id can be the very same as a field name in the database ("Company"). This Id property and several others are appended to set of properties for each control on the form. To set a value to a control with Id looks like this:
[Visual Basic]
ItemBindingExtender1.SetItemText("Company", "PureComponents")
[C#]
ItemBindingExtender1.SetItemText("Company", "PureComponents");
In very similar way you can set any property of the control:
[Visual Basic]
ItemBindingExtender1.SetItemVisible("Company", True) ItemBindingExtender1.SetItemEnabled("Company", False) ItemBindingExtender1.SetItemProperty("Company", "BackColor", Color.Yellow)
[C#]
ItemBindingExtender1.SetItemVisible("Company", true); ItemBindingExtender1.SetItemEnabled("Company", false); ItemBindingExtender1.SetItemProperty("Company", "BackColor", Color.Yellow);
ItemBindingExtender can work with all items at once. For example if you wish to show data from Customers table for a specific record, it can be done by single line of code:
[Visual Basic]
ItemBindingExtender1.SetItemValues(CustomerDataRow)
[C#]
ItemBindingExtender1.SetItemValues(CustomerDataRow);
SetItemValues method sets values to Text property of the associated control. In similar way it is possible to set values from other data objects and collections. Following examples cover all possibilities:
[Visual Basic]
'Set values from DataRow ItemBindingExtender1.SetItemValues(myDataRow1) 'Set values from SQLDataReader ItemBindingExtender1.SetItemValues(mySqlDataReader1) 'Set values from SQLDataReader ItemBindingExtender1.SetItemValues(myCustomerClass1) 'Set values from Hashtable ItemBindingExtender1.SetItemValues(myHashtable1) 'Set values from SortedList ItemBindingExtender1.SetItemValues(mySortedList1) 'Set values from NameValueCollection ItemBindingExtender1.SetItemValues(myNameValueCollection1) 'Set values from StringDictionary ItemBindingExtender1.SetItemValues(myStringDictionary1) 'Set values from ListDictionary ItemBindingExtender1.SetItemValues(myListDictionary1)
[C#]
//Set values from DataRow ItemBindingExtender1.SetItemValues(myDataRow1); //Set values from SQLDataReader ItemBindingExtender1.SetItemValues(mySqlDataReader1); //Set values from SQLDataReader ItemBindingExtender1.SetItemValues(myCustomerClass1); //Set values from Hashtable ItemBindingExtender1.SetItemValues(myHashtable1); //Set values from SortedList ItemBindingExtender1.SetItemValues(mySortedList1); //Set values from NameValueCollection ItemBindingExtender1.SetItemValues(myNameValueCollection1); //Set values from StringDictionary ItemBindingExtender1.SetItemValues(myStringDictionary1); //Set values from ListDictionary ItemBindingExtender1.SetItemValues(myListDictionary1);
ValidationExtender
ValidationExtender extends standard editing controls with validation functions. When you place ValidationExtender on the form where e.g. textboxes are found, these textboxes are extended with new properties and so called validators, by which the validation requirements can be set. ValidationExtender also works with other types of controls such as ListBox, ComboBox and Checkbox. More detailed information can be found in chapters, which describe particular types of validators
Validators
Each validator is determined to different type of validation. These validators are available.
Compare Validator
Compares values of two controls or control with specific value.
Condition Validator
Verifies requirement validity, which can contain values of different controls on the form, e.g. [MonthBudget]>=[Price]*[Quantity].
DataType Validator
Verifies the accuracy of data type, e.g.if the control value of data type is date.
Expression Validator
Verifies value validity on the bases of regular expression.
Length Validator
Checks value length.
List Validator
Verifies if the value is on the list of legal values.
Range Validator
Checks if the value is in allowed range of values.
Required Validator
Checks if there is an entered value at verified control.
Validators can be connected for the verifying of data validity.Control value can be verified by several validators at the time e.g. by Required Validator and Range Validator.
If you want to verify the control by some validator, you have to set appropriate properties and authorize the validation by setting the Enabled property to True. If this property has value False, validator does not execute the screening even though the other properties are set.

