Namespace: Consultingwerk.SmartComponents.Base
Class 
SmartLookup Copy to Clipboard
Parent classes:
Inherits: Infragistics.Win.UltraWinEditors.UltraTextEditor
Implements: System.ComponentModel.ICustomTypeDescriptor, Consultingwerk.SmartComponents.Interfaces.IEmbeddedSmartEditor, Consultingwerk.SmartComponents.IHasDesignerVerbs
Inherited by: Consultingwerk.SmartComponents.Base.SmartBusinessEntityLookupDesign Consultingwerk.SmartComponents.Implementation.SmartBusinessEntityLookup Consultingwerk.SmartComponents.Implementation.SmartBusinessEntityPopupLookup Consultingwerk.Windows.Util.ComplexInputPrompt.ComplexInputSmartBusinessEntityLookupControl Consultingwerk.SmartComponents.Implementation.SmartDataObjectLookup Consultingwerk.SmartComponents.Implementation.SmartGenericLookup
ABSTRACT

File:SmartLookup
Purpose:Abstract base class for Lookup Controls
Author(s):Marko Rüterbories / Consultingwerk Ltd.
Created:Thu Mar 12 12:51:55 CET 2009
Notes:Extends an Infragistics UltraText Editor with Lookup
functionality. This base class is responsible for the
generic handling of the Lookup functionality (based on
values entered in the Control or raising the Lookup
Dialog). The base class is not responsible for the
data access itself. This is implemented in the
child classes of this class.
The SmartLookup can be used as an embedded
Editor for an UltraGrid Control's column. When doing so,
the OwningGrid property of the SmartLookup property
needs to by set to the reference of the UltraGrid.
When the Controls in the "LookupControls" list are
used as Embedded Editors to an UltraGrid it is required
to data bind those Controls to the same binding source
fields as the grid cells are that use those embedded
editors
/* Mike Fechner, Consultingwerk Ltd. 13.09.2017
Preprocessor variables for SmartComponentLibrary, WinKit and SmartFramework
based on Consultingwerk/packages.i now



Top Method Summary
Options Name Purpose
+ AddLookupEditorButton () This Method is used to add a LookupButton to the Control and sets Key and Text Properties.
# AssignLookupKeyValue () Assigns the Lookup Key Value to the column of the owning grid
# AssignValueToCell (UltraGridCell, character) Assigns a Character Value to a Cell
# CreateVerbs () Creates Designer Verbs based on the DesignerVerbs property
# DisposedHandler (Object, EventArgs) Event handler for the Disposed event of the SmartLookup instance
+ 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.
+ CHARACTER GetLookupRegistryKey () Prototype of the method GetLookupRegistryKey which can be used inside the LookupDialog class to set and store f.e. size and position of the Form.
+ 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.
# HandleKeyDown (KeyEventArgs) Handles F3 key to invoke ShowLookupDialog method. This Method is executed when the KeyDown Event of the base class is fired.
# InitializeTimer () Initializes the Timer Component
# LookupBrowserInitializeLayoutHandler (Object, InitializeLayoutEventArgs) Handles the InitializeLayout event of the Lookup Browser
# LookupTimerTick (Object, EventArgs) Event Handler for the Tick event of the Lookup Timer Component
# OnAfterPerformLookup (EventArgs) Raises the OnAfterPerformLookup event
# OnBeforePerformLookup (CancelEventArgs) Raises the BeforePerformLookup event
# OnEditorButtonClick (EditorButtonEventArgs) Raises the Invokes the EditorButtonClick event
# OnEnabledChanged (EventArgs) Raises the EnabledChanged event
# OnInitializeLookupBrowserLayout (InitializeLookupBrowserLayoutEventArgs) Raises the InitializeLookupBrowserLayout event
# OnKeyDown (KeyEventArgs) Handles F3 key to invoke ShowLookupDialog method. This Method is executed when the KeyDown Event of the base class is fired.
# OnKeyPress (KeyPressEventArgs) Raises the KeyPress event
# OnLeave (EventArgs) Raises the Leave event
# OnLookupCompleted (EventArgs) Raises the LookupCompleted event
# OnShowLookupDialog (CancelEventArgs) Raises the ShowLookupDialog event
# OnValueChanged (EventArgs) Raises the Value changed event
+ OnVerbClicked (character) Event Handler method for Designer Verbs
+ PerformKeyDown (KeyEventArgs) Performs the KeyDown event for an embedded SmartLookup
+ PerformKeyPress (KeyPressEventArgs) Performs the KeyPress event for an embedded SmartLookup
+ PerformLeave (CancelEventArgs) Performs the Leave (BeforeCellDeactivate) event for an embedded SmartLookup
+ A PerformLookup () Performs the lookup functioanlity, performs a call to the data source to retrieve the record based on the field value the user entered in the lookup control
# A PerformLookup (logical) Performs the lookup functioanlity, performs a call to the data source to retrieve the record based on the field value the user entered in the lookup control
+ PerformLookupIfActive () Calls PerformLookup only if the LookupTimer is currently enabled
- SetDesignerProperties () Sets Properties to customize Visual Designer behaviour
# A ShowLookupDialog () Shows the Lookup Dialog
# StartTimer () Activates the Lookup Timer Component
+ StopTimer () Deactivates the Lookup Timer Component
# UpdateCellsWithEmbeddedEditors () Updates cells in a Grid with values from embedded editors in case the lookup is owned by a grid

Top Constructor Summary
Options Name Purpose
+ SmartLookup () Constructor of the SmartLookup class

Top Event Summary
Options Name Purpose
+ AfterPerformLookup DELEGATE System.EventHandler Event raised after the lookup has performed a search
+ BeforePerformLookup DELEGATE System.ComponentModel.CancelEventHandler Event raised before the lookup performs a search
+ InitializeLookupBrowserLayout (Object, InitializeLookupBrowserLayoutEventArgs) Event raised when the Lookup Dialog's browser is performing it's layout
+ LookupComplete DELEGATE System.EventHandler Event raised when the Lookup has returned a record
+ ShowLookupDialog DELEGATE System.ComponentModel.CancelEventHandler Event raised before the Lookup Dialog is shown

Top Property Summary
Options Name Purpose
+ LOGICAL AddLookupButton
# CHARACTER BindableProperties
# CHARACTER CategorizedProperties
# CHARACTER CategoryProperties
# CHARACTER DescribedProperties
# CHARACTER DescriptionProperties
# CHARACTER DesignerVerbs
# CHARACTER DesignerVisibilityAttributes
# CHARACTER DesignerVisibilityProperties
# LOGICAL DesignTime
# CHARACTER HiddenProperties
+ CHARACTER LookupBrowserExcludeFields
+ CHARACTER LookupBrowserFields
# LOGICAL LookupClearPending
+ CHARACTER LookupControls
+ CHARACTER LookupDialogTitle
+ CHARACTER LookupFields
+ CHARACTER LookupKeyField
+ System.Windows.Forms.Timer LookupTimer
+ INTEGER LookupTimerDelay
+ LOGICAL LookupTimerDisabled
# CHARACTER NonBrowsableProperties
+ Infragistics.Win.UltraWinGrid.UltraGrid OwningGrid


Method Detail
Top

PUBLIC AddLookupEditorButton ()

Purpose: This Method is used to add a LookupButton to the Control and sets
Key and Text Properties.
Notes: Invoked by the Property setter of AddLookupButton or the Designer Verb

Top

PROTECTED AssignLookupKeyValue ()

Purpose: Assigns the Lookup Key Value to the column of the owning
grid
Notes:

Top

PROTECTED AssignValueToCell (UltraGridCell, character)

Purpose: Assigns a Character Value to a Cell
Notes:

Parameters:
poCell Infragistics.Win.UltraWinGrid.UltraGridCell
The UltraGridCell to assign the value to
pcValue CHARACTER
The value to assign to the cell
Top

PROTECTED CreateVerbs ()

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

Top

PROTECTED DisposedHandler (Object, EventArgs)

Purpose: Event handler for the Disposed event of the SmartLookup instance
Notes: Not subscribed during development, stops the Lookup Timer if it
should still be active

Parameters:
sender System.Object
The reference to the object that raised this event
e System.EventArgs
The System.EventArgs with no data for this event
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 CHARACTER GetLookupRegistryKey ()

Purpose: Prototype of the method GetLookupRegistryKey which can be used inside
the LookupDialog class to set and store f.e. size and position of the
Form.
Notes: This Method needs to be overridden in a SmartLookup derived class to
return a valid registry key name.

Returns CHARACTER
The Lookup Registry Key
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

PROTECTED HandleKeyDown (KeyEventArgs)

Purpose: Handles F3 key to invoke ShowLookupDialog method.
This Method is executed when the KeyDown Event of the base class is
fired.
Notes:

Parameters:
e System.Windows.Forms.KeyEventArgs
System.Windows.Forms.KeyEventArgs
Top

PROTECTED InitializeTimer ()

Purpose: Initializes the Timer Component
Notes:

Top

PROTECTED LookupBrowserInitializeLayoutHandler (Object, InitializeLayoutEventArgs)

Purpose: Handles the InitializeLayout event of the Lookup Browser
Notes:

Parameters:
sender System.Object
The reference to the object that raised the event
e Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs
The InitializeLayoutEventArgs with the data for this event
Top

PROTECTED LookupTimerTick (Object, EventArgs)

Purpose: Event Handler for the Tick event of the Lookup Timer Component
Notes:

Parameters:
sender System.Object
The reference to the object that raised the event
e System.EventArgs
The System.EventArgs with the data for this event
Top

PROTECTED OnAfterPerformLookup (EventArgs)

Purpose: Raises the OnAfterPerformLookup event
Notes: Invoked after the Lookup has fetched data

Parameters:
e System.EventArgs
The System.EventArgs with the data for this event
Top

PROTECTED OnBeforePerformLookup (CancelEventArgs)

Purpose: Raises the BeforePerformLookup event
Notes: Cancellable event, raised when the user leaves the Lookup field or
after changing the Text in the Lookup Control and waiting for the
LookupTimer to fire

Parameters:
e System.ComponentModel.CancelEventArgs
The CancelEventArgs with the data for this event
Top

PROTECTED OnEditorButtonClick (EditorButtonEventArgs)

Purpose: Raises the Invokes the EditorButtonClick event
Notes:

Parameters:
e Infragistics.Win.UltraWinEditors.EditorButtonEventArgs
The EditorButtonEventArgs with the data for this event
Top

PROTECTED OnEnabledChanged (EventArgs)

Purpose: Raises the EnabledChanged event
Notes: Stops the Lookup timer when the Control get's disabled

Parameters:
e System.EventArgs
The System.EventArgs with the data for this event
Top

PROTECTED OnInitializeLookupBrowserLayout (InitializeLookupBrowserLayoutEventArgs)

Purpose: Raises the InitializeLookupBrowserLayout event
Notes:

Parameters:
e Consultingwerk.SmartComponents.Base.InitializeLookupBrowserLayoutEventArgs
The InitializeLookupBrowserLayoutEventArgs with the data for this event
Top

PROTECTED OnKeyDown (KeyEventArgs)

Purpose: Handles F3 key to invoke ShowLookupDialog method.
This Method is executed when the KeyDown Event of the base class is
fired.
Notes:

Parameters:
e System.Windows.Forms.KeyEventArgs
System.Windows.Forms.KeyEventArgs
Top

PROTECTED OnKeyPress (KeyPressEventArgs)

Purpose: Raises the KeyPress event
Notes: Starts the Lookup Timer when the Control has Focus

Parameters:
e System.Windows.Forms.KeyPressEventArgs
The KeyPressEventArgs with the data for this event
Top

PROTECTED OnLeave (EventArgs)

Purpose: Raises the Leave event
Notes: When the Control Leave event ocurs the TimerTick event is
simulated, so that the lookup will be performed

Parameters:
e System.EventArgs
Default .NET System.EventArgs (empty event argument)
Top

PROTECTED OnLookupCompleted (EventArgs)

Purpose: Raises the LookupCompleted event
Notes: Invokes the LookupCompleted call back in the SmartViewerControl
(when ILookupCompleteCallback is implemented).
Thid Method is called by ShowLookupDialog in a SmartLookup derived
class to perform the callback to the container.

Parameters:
e System.EventArgs
The System.EventArgs with the data for this event
Top

PROTECTED OnShowLookupDialog (CancelEventArgs)

Purpose: Raises the ShowLookupDialog event
Notes: Cancellable event

Parameters:
e System.ComponentModel.CancelEventArgs
Default .NET CancelEventArgs (cancellable event argument)
Top

PROTECTED OnValueChanged (EventArgs)

Purpose: Raises the Value changed event
Notes: Sets the Lookup pending property when not using the Lookup timer

Parameters:
e System.EventArgs
The System.EventArgs with the data for this event
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

PUBLIC PerformKeyDown (KeyEventArgs)

Purpose: Performs the KeyDown event for an embedded SmartLookup
Notes: Only supported when the lookup is used as an embedded editor

Parameters:
e System.Windows.Forms.KeyEventArgs
The KeyEventArgs of the original UltraGrid event
Top

PUBLIC PerformKeyPress (KeyPressEventArgs)

Purpose: Performs the KeyPress event for an embedded SmartLookup
Notes: Only supported when the lookup is used as an embedded editor

Parameters:
e System.Windows.Forms.KeyPressEventArgs
The KeyPressEventArgs of the original UltraGrid event
Top

PUBLIC PerformLeave (CancelEventArgs)

Purpose: Performs the Leave (BeforeCellDeactivate) event for an embedded SmartLookup
Notes: Only supported when the lookup is used as an embedded editor

Parameters:
e System.ComponentModel.CancelEventArgs
The CancelEventArgs of the original UltraGrid event
Top

PUBLIC PerformLookup ()

Purpose: Performs the lookup functioanlity, performs a call to the data source
to retrieve the record based on the field value the user entered
in the lookup control
Notes: Abstract method that needs to be overidden in a more specialized
Lookup class, public method, that always assumes that the lookup has
no longer focus. Calls into PerformLookup (TRUE).

Top

PROTECTED PerformLookup (logical)

Purpose: Performs the lookup functioanlity, performs a call to the data source
to retrieve the record based on the field value the user entered
in the lookup control
Notes: Abstract method that needs to be overidden in a more specialized
Lookup class

Parameters:
plLostFocus LOGICAL
Logical value indicating if the PerformLookup was invoked due to a loss of focus
Top

PUBLIC PerformLookupIfActive ()

Purpose: Calls PerformLookup only if the LookupTimer is currently enabled
Notes: Called by the SmartViewerControl at the begin of a Save operations

Top

PRIVATE SetDesignerProperties ()

Purpose: Sets Properties to customize Visual Designer behaviour
Notes:

Top

PROTECTED ShowLookupDialog ()

Purpose: Shows the Lookup Dialog
Notes: This Method needs to be overridden in a SmartLookup derived class.

Top

PROTECTED StartTimer ()

Purpose: Activates the Lookup Timer Component
Notes:

Top

PUBLIC StopTimer ()

Purpose: Deactivates the Lookup Timer Component
Notes:

Top

PROTECTED UpdateCellsWithEmbeddedEditors ()

Purpose: Updates cells in a Grid with values from embedded editors in case
the lookup is owned by a grid
Notes: This method requires that the embedded editors are data bound to binding
source columns



Constructor Detail
Top

PUBLIC SmartLookup ()

Purpose: Constructor of the SmartLookup class
Notes:



Event Detail
Top

PUBLIC AfterPerformLookup DELEGATE System.EventHandler

Purpose: Event raised after the lookup has performed a search
Notes:

Delegate: System.EventHandler
Top

PUBLIC BeforePerformLookup DELEGATE System.ComponentModel.CancelEventHandler

Purpose: Event raised before the lookup performs a search
Notes: The cancellable event is raised before the Lookup action is performed.
The event still allows to modify properties relevant to the Lookup
(such as modifying the LookupQueryString)

Delegate: System.ComponentModel.CancelEventHandler
Top

PUBLIC InitializeLookupBrowserLayout (Object, InitializeLookupBrowserLayoutEventArgs)

Purpose: Event raised when the Lookup Dialog's browser is performing it's
layout
Notes:

Parameters:
sender System.Object
The reference to the object that raised the event
e Consultingwerk.SmartComponents.Base.InitializeLookupBrowserLayoutEventArgs
The reference to the InitializeLookupBrowserLayoutEventArgs with data for this event
Top

PUBLIC LookupComplete DELEGATE System.EventHandler

Purpose: Event raised when the Lookup has returned a record
Notes:

Delegate: System.EventHandler
Top

PUBLIC ShowLookupDialog DELEGATE System.ComponentModel.CancelEventHandler

Purpose: Event raised before the Lookup Dialog is shown
Notes: The cancelable event is raised before the Lookup Dialog is
instantiated and shown. This event still allows to modify properties
relevant for the Lookup Dialog.

Delegate: System.ComponentModel.CancelEventHandler


Property Detail
Top

PUBLIC LOGICAL AddLookupButton


Returns LOGICAL
Top

PROTECTED CHARACTER BindableProperties


Returns CHARACTER
Top

PROTECTED CHARACTER CategorizedProperties


Returns CHARACTER
Top

PROTECTED CHARACTER CategoryProperties


Returns CHARACTER
Top

PROTECTED CHARACTER DescribedProperties


Returns CHARACTER
Top

PROTECTED CHARACTER DescriptionProperties


Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVerbs


Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVisibilityAttributes


Returns CHARACTER
Top

PROTECTED CHARACTER DesignerVisibilityProperties


Returns CHARACTER
Top

PROTECTED LOGICAL DesignTime


Returns LOGICAL
Top

PROTECTED CHARACTER HiddenProperties


Returns CHARACTER
Top

PUBLIC CHARACTER LookupBrowserExcludeFields


Returns CHARACTER
Top

PUBLIC CHARACTER LookupBrowserFields


Returns CHARACTER
Top

PROTECTED LOGICAL LookupClearPending


Returns LOGICAL
Top

PUBLIC CHARACTER LookupControls


Returns CHARACTER
Top

PUBLIC CHARACTER LookupDialogTitle


Returns CHARACTER
Top

PUBLIC CHARACTER LookupFields


Returns CHARACTER
Top

PUBLIC CHARACTER LookupKeyField


Returns CHARACTER
Top

PUBLIC System.Windows.Forms.Timer LookupTimer


Returns System.Windows.Forms.Timer
Top

PUBLIC INTEGER LookupTimerDelay


Returns INTEGER
Top

PUBLIC LOGICAL LookupTimerDisabled


Returns LOGICAL
Top

PROTECTED CHARACTER NonBrowsableProperties


Returns CHARACTER
Top

PUBLIC Infragistics.Win.UltraWinGrid.UltraGrid OwningGrid


Returns Infragistics.Win.UltraWinGrid.UltraGrid


©2006-2020 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       04.02.2020 23:16:23