Namespace: Consultingwerk.SmartComponents.Implementation
Class 
SmartBindingSource Copy to Clipboard
Parent classes:
Inherits: Progress.Data.BindingSource
Implements: System.ComponentModel.ICustomTypeDescriptor, Consultingwerk.SmartComponents.IHasDesignerVerbs
Inherited by: Consultingwerk.SmartComponents.Implementation.SmartBusinessEntityBindingSource, Consultingwerk.SmartComponents.Implementation.SmartDataObjectBindingSource

File:SmartBindingSource
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Feb 25 08:23:25 CET 2009



Top Method Summary
Options Name Purpose
# AddControlsForChosenFields (TableDesc, logical, character) Add controls (Label and DataControl) for each choosen field of the currently processed table to the design canvas.
# System.Windows.Forms.Control CreateControlForField (DataType, character, character, character) Create a Control for a field from the Design time binding source
# System.Windows.Forms.Control CreateLabelForField (DataType, character, character, character) Create a Control for the label of a field from the Design time binding source
# CreateVerbs () Creates Designer Verbs based on the DesignerVerbs property
# DesignerAddFields () Add the selected Fields from the current schema of the SmartBindingSource to the design canvas.
# DesignerClearSchema () Clear the currently present Schema of the SmartBindingSource. This Method is called when the Property ClearSchema is set to TRUE.
# DesignerImportSchema () Import the schema of one or more tables selected from one or more connected databases. This Method is called when the Property ImportSchema is set to TRUE. A Dataset is filled with the Metaschema information and passed to a .NET Dialog as XML information. After the user has choosen one or more fields an Alias is created for the choosen Database and a second Dataset is filled with the Schema information of the choosen Table and Fields. This second Dataset is then processed and every selected Field is added to a Tabledescription variable witch is then set as the TableSchema of the current SmartBindingSource Instance.
- FillDatasetMetaschema () Fill the Dataset dsMetaschema with all connected database names their tables and fields. This Method is called by DesignerImportSchema () to get a list of all Databases their Tables and Fields to be passed into a .NET dialog as XML information.
+ System.ComponentModel.AttributeCollection GetAttributes () Returns a collection of custom attributes for this instance of a component.
+ CHARACTER GetClassName () Returns the class name of this instance of a component.
+ CHARACTER GetComponentName () Returns the name of this instance of a component.
+ System.ComponentModel.TypeConverter GetConverter () Returns a type converter for this instance of a component.
+ System.ComponentModel.EventDescriptor GetDefaultEvent () Returns the default event for this instance of a component.
+ System.ComponentModel.PropertyDescriptor GetDefaultProperty () Returns the default property for this instance of a component.
+ System.Object GetEditor (Type) Returns an editor of the specified type for this instance of a component.
+ System.ComponentModel.EventDescriptorCollection GetEvents () Returns the events for this instance of a component.
+ System.ComponentModel.EventDescriptorCollection GetEvents (Attribute[]) Returns the events for this instance of a component using the specified attribute array as a filter.
+ System.ComponentModel.PropertyDescriptorCollection GetProperties () Returns the properties for this instance of a component.
+ System.ComponentModel.PropertyDescriptorCollection GetProperties (Attribute[]) Returns the properties for this instance of a component using the attribute array as a filter.
+ System.Object GetPropertyOwner (PropertyDescriptor) Returns an object that contains the property described by the specified property descriptor.
+ OnVerbClicked (character) Event Handler method for Designer Verbs
- RecurseAddControls (TableDesc, logical, character) Recursively walk through the BindingSource predefined schema and add every choosen Field to the Design Canvas.
- SetDesignerProperties () Sets Properties to customize Visual Designer behaviour

Top Constructor Summary
Options Name Purpose
+ SmartBindingSource () Constructor of the SmartBindingSource class. Set's the DesignTime property using the LicenseManager.
+ SmartBindingSource (IContainer) Constructor of the SmartBindingSource class

Top Property Summary
Options Name Purpose
+ LOGICAL AddFields If Property is set a Dialog is Shown to Add fields from the Metaschema to the Design Canvas.
# CHARACTER BindableProperties Property that is used to mark properties (comma-delimited list) that should be Data-Bindable
# CHARACTER CategorizedProperties Property that is used to mark properties (comma-delimited list) that should receive a Category attribute
# CHARACTER CategoryProperties Categories of the Property in the CategorizedProperty list
+ LOGICAL ClearSchema If Property is set the Metaschema is cleared.
# System.Collections.Generic.Dictionary <System.String> CustomControlTypes A Dictionary of custom types
# CHARACTER DescribedProperties Property that is used to mark properties (comma-delimited list) that should receive a Description attribute
# CHARACTER DescriptionProperties Description of the Property in the DescribedProperties list
# CHARACTER DesignerVerbs Property that is used to generate Designer Verbs (actions for the Visual Designer)
# CHARACTER DesignerVisibilityAttributes The CHARACTER representation of the DesignerSerializationVisibiltiy attribute (Content/Visible/Hidden), see .NET Enumeration System.ComponentModel.DesignerSerializationVisibility
# CHARACTER DesignerVisibilityProperties Property that is used to mark properties (comma-delimited list) that should receive a DesignerSerializationVisibility Attribute
# LOGICAL DesignTime Propery flags if the current instance of the SmartBindingSource is running at design time or runtime.
# CHARACTER HiddenProperties Property that is used to mark properties (comma-delimited list) that will be excluded from the .NET TypeDescriptor properties list
+ LOGICAL ImportSchema If Property is set a Dialog is Shown where the user can choose a Fields from a Databasetable to be automaticly build into the SmartBindingSources Metaschema. The Value of this Property is not changed but the Dialog is started when temporarily set to TRUE.
# CHARACTER NonBrowsableProperties Property that is used to mark properties (comma-delimited list) that should not show up in the Visual Designers Property Grid


Method Detail
Top

PROTECTED AddControlsForChosenFields (TableDesc, logical, character)

Purpose: Add controls (Label and DataControl) for each choosen field of the
currently processed table to the design canvas.
Notes: This Method is called by RecurseAddControls ().
First the name of the new Controls is build from the column name
and the SmartBindingSource Instance Name. Possibly the Name
occures more than once so it gets iterated from the second time on.
After this an UltraLabel and a Datatype specific EditorControl is
added to the Design Canvas.

Parameters:
oTable Progress.Data.TableDesc
The TableDesc to be processed
plPrefixWithTable LOGICAL
Shall ControlNames be prefixed with the TableName
cChoosenColumns CHARACTER
List of ColumnNames selected in the AddFields Dialog
Top

PROTECTED System.Windows.Forms.Control CreateControlForField (DataType, character, character, character)

Purpose: Create a Control for a field from the Design time binding source
Notes: Uses IDesignerHost:CreateComponent

Parameters:
poType Progress.Data.DataType
The DataType of the field
pcControlName CHARACTER
The name of the Control
pcColumnName CHARACTER
The name of the Column
pcColumnLabel CHARACTER
The label of the Column
Returns System.Windows.Forms.Control
The reference to the Control that was created
Top

PROTECTED System.Windows.Forms.Control CreateLabelForField (DataType, character, character, character)

Purpose: Create a Control for the label of a field from the Design time
binding source
Notes: Uses IDesignerHost:CreateComponent

Parameters:
poType Progress.Data.DataType
The DataType of the Control
pcControlName CHARACTER
The name of the Control
pcColumnName CHARACTER
The name of the Column
pcColumnLabel CHARACTER
The label of the Column
Returns System.Windows.Forms.Control
The reference to the Control that was created
Top

PROTECTED CreateVerbs ()

Purpose: Creates Designer Verbs based on the DesignerVerbs property
Notes:

Top

PROTECTED DesignerAddFields ()

Purpose: Add the selected Fields from the current schema of the
SmartBindingSource to the design canvas.
Notes: A Dialog is shown to select fields and if fields are selected
the Controls are added recursively.

Top

PROTECTED DesignerClearSchema ()

Purpose: Clear the currently present Schema of the SmartBindingSource.
This Method is called when the Property ClearSchema is set to
TRUE.
Notes:

Top

PROTECTED DesignerImportSchema ()

Purpose: Import the schema of one or more tables selected from one or
more connected databases.
This Method is called when the Property ImportSchema is set to
TRUE.
A Dataset is filled with the Metaschema information and passed
to a .NET Dialog as XML information. After the user has
choosen one or more fields an Alias is created for the choosen
Database and a second Dataset is filled with the Schema
information of the choosen Table and Fields. This second
Dataset is then processed and every selected Field is added to
a Tabledescription variable witch is then set as the
TableSchema of the current SmartBindingSource Instance.
Notes: The Method may be overridden to import the schema from other
datasources

Top

PRIVATE FillDatasetMetaschema ()

Purpose: Fill the Dataset dsMetaschema with all connected database names
their tables and fields.
This Method is called by DesignerImportSchema () to get a list
of all Databases their Tables and Fields to be passed into a
.NET dialog as XML information.
Notes:

Top

PUBLIC System.ComponentModel.AttributeCollection GetAttributes ()

Purpose: Returns a collection of custom attributes for this instance of a
component.
Notes:

Returns System.ComponentModel.AttributeCollection
The System.ComponentModel.AttributeCollection describing the types attributes
Top

PUBLIC CHARACTER GetClassName ()

Purpose: Returns the class name of this instance of a component.
Notes:

Returns CHARACTER
The class name of the Component
Top

PUBLIC CHARACTER GetComponentName ()

Purpose: Returns the name of this instance of a component.
Notes:

Returns CHARACTER
The Component Name of this instance
Top

PUBLIC System.ComponentModel.TypeConverter GetConverter ()

Purpose: Returns a type converter for this instance of a component.
Notes:

Returns System.ComponentModel.TypeConverter
The System.ComponentModel.TypeConverter for this instance of a component.
Top

PUBLIC System.ComponentModel.EventDescriptor GetDefaultEvent ()

Purpose: Returns the default event for this instance of a component.
Notes:

Returns System.ComponentModel.EventDescriptor
The System.ComponentModel.EventDescriptor for the default event of this component
Top

PUBLIC System.ComponentModel.PropertyDescriptor GetDefaultProperty ()

Purpose: Returns the default property for this instance of a component.
Notes:

Returns System.ComponentModel.PropertyDescriptor
The System.ComponentModel.PropertyDescriptor for the default property of the component
Top

PUBLIC System.Object GetEditor (Type)

Purpose: Returns an editor of the specified type for this instance of a
component.
Notes:

Parameters:
editorBaseType System.Type
A System.Type that represents the editor for this object.
Returns System.Object
The reference to the Editor of the type of the component instance
Top

PUBLIC System.ComponentModel.EventDescriptorCollection GetEvents ()

Purpose: Returns the events for this instance of a component.
Notes:

Returns System.ComponentModel.EventDescriptorCollection
The System.ComponentModel.EventDescriptorCollection describing the events of the component
Top

PUBLIC System.ComponentModel.EventDescriptorCollection GetEvents (Attribute[])

Purpose: Returns the events for this instance of a component using the
specified attribute array as a filter.
Notes:

Parameters:
attributes System.Attribute[]
A System.Attribute[] that is used as a filter.
Returns System.ComponentModel.EventDescriptorCollection
The System.ComponentModel.EventDescriptorCollection describing the events of the component
Top

PUBLIC System.ComponentModel.PropertyDescriptorCollection GetProperties ()

Purpose: Returns the properties for this instance of a component.
Notes:

Returns System.ComponentModel.PropertyDescriptorCollection
A System.ComponentModel.PropertyDescriptorCollection that represents the properties for this component instance.
Top

PUBLIC System.ComponentModel.PropertyDescriptorCollection GetProperties (Attribute[])

Purpose: Returns the properties for this instance of a component using the
attribute array as a filter.
Notes:

Parameters:
attributes System.Attribute[]
A System.Attribute[] that is used as a filter.
Returns System.ComponentModel.PropertyDescriptorCollection
A System.ComponentModel.PropertyDescriptorCollection that represents the properties for this component instance.
Top

PUBLIC System.Object GetPropertyOwner (PropertyDescriptor)

Purpose: Returns an object that contains the property described by the
specified property descriptor.
Notes:

Parameters:
pd System.ComponentModel.PropertyDescriptor
A System.ComponentModel.PropertyDescriptor that represents the property whose owner is to be found.
Returns System.Object
An System.Object that represents the owner of the specified property.
Top

PUBLIC OnVerbClicked (character)

Purpose: Event Handler method for Designer Verbs
Notes: This method is intended to be overridden

Parameters:
pcVerbText CHARACTER
The name (Label) of the Designer Verb that was invoked
Top

PRIVATE RecurseAddControls (TableDesc, logical, character)

Purpose: Recursively walk through the BindingSource predefined schema
and add every choosen Field to the Design Canvas.
Notes: This Method is called from DesignerAddFields () after the Dialog
to chose fields had been shown and one ore more fields has been
selected.

Parameters:
oTable Progress.Data.TableDesc
The current TableDesc to be processed
plPrefixWithTable LOGICAL
Shall ControlNames be prefixed with the TableName
cChoosenColumns CHARACTER
List of ColumnNames selected in the AddFields Dialog
Top

PRIVATE SetDesignerProperties ()

Purpose: Sets Properties to customize Visual Designer behaviour
Notes:



Constructor Detail
Top

PUBLIC SmartBindingSource ()

Purpose: Constructor of the SmartBindingSource class. Set's the
DesignTime property using the LicenseManager.
Notes: According to
http://dotnetfacts.blogspot.com/2009/01/identifying-run-time-and-design-mode.html
that is only possible during the constructor of the class.

Top

PUBLIC SmartBindingSource (IContainer)

Purpose: Constructor of the SmartBindingSource class
Notes: Set's the DesignTime property using the LicenseManager. According to
http://dotnetfacts.blogspot.com/2009/01/identifying-run-time-and-design-mode.html
that is only possible during the constructor of the class.

Parameters:
poContainer System.ComponentModel.IContainer
The IContainer to add the SmartBusinessEntityAdapter to.


Property Detail
Top

PUBLIC LOGICAL AddFields

Purpose: If Property is set a Dialog is Shown to Add fields from the
Metaschema to the Design Canvas.
Notes: The Value of this Property is not changed but the Dialog is started
when temporarily set to TRUE.
Workaround to be able to start a Dialog from Propertygrid.

Returns LOGICAL
Top

PROTECTED CHARACTER BindableProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
should be Data-Bindable
Notes: C# Annotation: [Bindable(true)]

Returns CHARACTER
Top

PROTECTED CHARACTER CategorizedProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
should receive a Category attribute
Notes: C# Annotation: [Category("...")]
This is a comma delimited list

Returns CHARACTER
Top

PROTECTED CHARACTER CategoryProperties

Purpose: Categories of the Property in the CategorizedProperty list
Notes: C# Annotation: [Category("...")]
This is a comma delimited list

Returns CHARACTER
Top

PUBLIC LOGICAL ClearSchema

Purpose: If Property is set the Metaschema is cleared.
Notes: The Value of this Property is not changed when temporarily set to
TRUE.
Workaround to be able to start Tasks from Propertygrid.

Returns LOGICAL
Top

PROTECTED System.Collections.Generic.Dictionary <System.String> CustomControlTypes

Purpose: A Dictionary of custom types
Notes: Allows simplyfied customization of the SmartBindingSource in case a
customer wants to create instances of derived control types. The
dictionary should contain the type names of the derived contorls.
Controls will need to extend the following Infragistics types:
INTEGER, DECIMAL: Infragistics.Win.UltraWinEditors.UltraNumericEditor
LOGICAL: Infragistics.Win.UltraWinEditors.UltraCheckEditor
DATE, DATETIME: Infragistics.Win.UltraWinEditors.UltraDateTimeEditor
CHARACTeR (OTHERWISE): Infragistics.Win.UltraWinEditors.UltraTextEditor

Returns System.Collections.Generic.Dictionary <System.String>
Top

PROTECTED CHARACTER DescribedProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
should receive a Description attribute
Notes: C# Annotation: [Description("...")]
This is a comma delimited list

Returns CHARACTER
Top

PROTECTED CHARACTER DescriptionProperties

Purpose: Description of the Property in the DescribedProperties list
Notes: C# Annotation: [Description("...")]
This is a CHR(1) delimited list

Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVerbs

Purpose: Property that is used to generate Designer Verbs (actions for the
Visual Designer)
Notes:

Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVisibilityAttributes

Purpose: The CHARACTER representation of the DesignerSerializationVisibiltiy
attribute (Content/Visible/Hidden), see .NET Enumeration
System.ComponentModel.DesignerSerializationVisibility
Notes: C# Annotation: [DesignerSerializationVisibility(...)]
This is a comma delimited list

Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVisibilityProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
should receive a DesignerSerializationVisibility Attribute
Notes: C# Annotation: [DesignerSerializationVisibility(...)]
This is a comma delimited list

Returns CHARACTER
Top

PROTECTED LOGICAL DesignTime

Purpose: Propery flags if the current instance of the SmartBindingSource
is running at design time or runtime.
Notes: Set during constructor using a check at the
System.ComponentModel.LicenseManager

Returns LOGICAL
Top

PROTECTED CHARACTER HiddenProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
will be excluded from the .NET TypeDescriptor properties list
Notes:

Returns CHARACTER
Top

PUBLIC LOGICAL ImportSchema

Purpose: If Property is set a Dialog is Shown where the user can choose a
Fields from a Databasetable to be automaticly build into the
SmartBindingSources Metaschema.
The Value of this Property is not changed but the Dialog is started
when temporarily set to TRUE.
Notes: Workaround to be able to start a Dialog from Propertygrid.

Returns LOGICAL
Top

PROTECTED CHARACTER NonBrowsableProperties

Purpose: Property that is used to mark properties (comma-delimited list) that
should not show up in the Visual Designers Property Grid
Notes:

Returns CHARACTER


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:31:45