Namespace: Consultingwerk.SmartComponents.Base
Class 
SmartWindowFormController Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:SmartWindowFormController
Purpose:Delegate for shared functionality between SmartWindowsForm
and SmartRadWindowForm and SmartRadRibbonWindowForm
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Apr 08 20:39:21 CEST 2015
/* 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
+ ActivateLinks (Control) Activates the Links between the active control and the SmartToolbarController
# LOGICAL CheckForPendingTransactions () Checks for pending transactions in a SmartBusinessEntityAdpater in the Form or UserControl in the Form
# FilterSmartBusinessEntityAdapter (Component>, Component>) Adds all SmartBusinessEntityAdpater instances (based on the ISmartCommitTarget interface) from the Source list to the Target list
+ FormClosingHandler (FormClosingEventArgs) Delegate for the FormClosing event handler
# GetAllSmartBusinessEntityAdapterInControls (Control+ControlCollection, Component>) Loops recursively through Controls and Child-Controls and adds all SmartBusinessEntityAdapter instances to the target list
+ Consultingwerk.SmartComponents.Base.ListSmartDataAdapter GetLinkedDataAdapters () Returns a List of Data Adapter instances in the Form
+ Consultingwerk.SmartComponents.Base.ListSmartDataAdapter GetLinkedDataAdapters (SmartDataAdapter) Returns a List of Data Adapter instances in the Form
+ GetLinkedDataAdapters (SmartDataAdapter, ListSmartDataAdapter) Add linked SmartDataAdapter instances to a List
+ InitializeFrameworkBootstrap () Initializes the Framework Bootstrap
# KeyDownHandler (Object, KeyEventArgs) Event handler for the KeyDown event of the Form
+ LoadHandler () Delegate for the Load event handler
+ Consultingwerk.Framework.Enum.DialogResultEnum PromptForSaveOfPendingChangesOnClose () Shows the Prompt to save pending transactions to the backend while closing the Form
+ LOGICAL RecurseCheckIsOkToClose (Control+ControlCollection, logical, CloseReason) Recursivly ask all Controls implementing the ICheckOkToClose Interface wheather it is ok to close the form.
+ LOGICAL RecurseSaveChangesOnDeactivateForm (Control+ControlCollection, logical) Recursively checks all contained controls to save changes on Deactivate of the Form
+ RemoveDataLinks () Removes Data links from all contained SmartDataTargets when the Form is closed

Top Constructor Summary
Options Name Purpose
+ SmartWindowFormController (ISmartWindowForm) Constructor for the SmartWindowFormController class

Top Property Summary
Options Name Purpose
+ Consultingwerk.SmartComponents.Interfaces.ISmartWindowForm Form
+ System.Collections.Generic.List <System.Type> MapEnterKeyControlTypeList
+ LOGICAL MapEnterKeyToTab


Method Detail
Top

PUBLIC ActivateLinks (Control)

Purpose: Activates the Links between the active control and the
SmartToolbarController
Notes: When the ActiveControl is a read-only Browse, we attempt to activate
the TableIO Link on another Data-Target of the Browsers SmartDataAdapter
That could be a Viewer with is linked to the same adapter

Parameters:
poActiveControl System.Windows.Forms.Control
The Control where the Links should be activated
Top

PROTECTED LOGICAL CheckForPendingTransactions ()

Purpose: Checks for pending transactions in a SmartBusinessEntityAdpater
in the Form or UserControl in the Form
Notes: Invoked while closing the Form, dependent on the ComponentsCollection

Returns LOGICAL
Logical vlaue indicating if the Form can be closed
Top

PROTECTED FilterSmartBusinessEntityAdapter (Component>, Component>)

Purpose: Adds all SmartBusinessEntityAdpater instances (based on the ISmartCommitTarget
interface) from the Source list to the Target list
Notes:

Parameters:
poSourceList System.Collections.Generic.List
The source list to filter for ISmartCommitTarget instances
poTargetList System.Collections.Generic.List
The target list to add instances to
Top

PUBLIC FormClosingHandler (FormClosingEventArgs)

Purpose: Delegate for the FormClosing event handler
Notes:

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

PROTECTED GetAllSmartBusinessEntityAdapterInControls (Control+ControlCollection, Component>)

Purpose: Loops recursively through Controls and Child-Controls and adds all
SmartBusinessEntityAdapter instances to the target list
Notes:

Parameters:
poControls System.Windows.Forms.Control+ControlCollection
The current iteration of the Controls collections
poTargetList System.Collections.Generic.List
The List<Component> to add the Components to
Top

PUBLIC Consultingwerk.SmartComponents.Base.ListSmartDataAdapter GetLinkedDataAdapters ()

Purpose: Returns a List of Data Adapter instances in the Form
Notes: Returns the PrimaryDataTarget (when that's a Data Adapter) and
the PrimaryDataSource as well as all their DataTarget instances

Returns Consultingwerk.SmartComponents.Base.ListSmartDataAdapter
The List of Data Adapter instances
Top

PUBLIC Consultingwerk.SmartComponents.Base.ListSmartDataAdapter GetLinkedDataAdapters (SmartDataAdapter)

Purpose: Returns a List of Data Adapter instances in the Form
Notes: Returns the PrimaryDataTarget (when that's a Data Adapter) and
the PrimaryDataSource or the poStart SmartDataAdapter instance
as well as all their DataTarget instances

Parameters:
poStart Consultingwerk.SmartComponents.Base.SmartDataAdapter
An optional reference to a SmartDataAdapter to use as the starting point
Returns Consultingwerk.SmartComponents.Base.ListSmartDataAdapter
The List of Data Adapter instances
Top

PUBLIC GetLinkedDataAdapters (SmartDataAdapter, ListSmartDataAdapter)

Purpose: Add linked SmartDataAdapter instances to a List
Notes: Used by GetLinkedDataAdpaters (poStart)

Parameters:
poStart Consultingwerk.SmartComponents.Base.SmartDataAdapter
The reference to a SmartDataAdapter to use as the starting point
poList Consultingwerk.SmartComponents.Base.ListSmartDataAdapter
The list of SmartDataAdapters to add to
Top

PUBLIC InitializeFrameworkBootstrap ()

Purpose: Initializes the Framework Bootstrap
Notes: Allows overriding in a custom Form base class

Top

PROTECTED KeyDownHandler (Object, KeyEventArgs)

Purpose: Event handler for the KeyDown event of the Form
Notes:

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

PUBLIC LoadHandler ()

Purpose: Delegate for the Load event handler
Notes:

Top

PUBLIC Consultingwerk.Framework.Enum.DialogResultEnum PromptForSaveOfPendingChangesOnClose ()

Purpose: Shows the Prompt to save pending transactions to the backend while
closing the Form
Notes:

Returns Consultingwerk.Framework.Enum.DialogResultEnum
The DialogResultEnum value indicating "Yes" to save changes, "No" to not save changes and "Cancel" to not close the Form
Top

PUBLIC LOGICAL RecurseCheckIsOkToClose (Control+ControlCollection, logical, CloseReason)

Purpose: Recursivly ask all Controls implementing the ICheckOkToClose Interface
wheather it is ok to close the form.
Notes:

Parameters:
poControls System.Windows.Forms.Control+ControlCollection
The System.Windows.Forms.Control+ControlCollection Collection of Controls to iterate
plShowMessage LOGICAL
When TRUE a message is Shown explaining why it is not ok to close the parent form.
poCloseReason System.Windows.Forms.CloseReason
The System.Windows.Forms.CloseReason passed from then OnFormClosing Method of the parent form giving the reason who closes the form.
Returns LOGICAL
Logical value indicating if the Form can be closed or not.
Top

PUBLIC LOGICAL RecurseSaveChangesOnDeactivateForm (Control+ControlCollection, logical)

Purpose: Recursively checks all contained controls to save changes on
Deactivate of the Form
Notes:

Parameters:
poControls System.Windows.Forms.Control+ControlCollection
The System.Windows.Forms.Control+ControlCollection Collection of Controls to iterate
plShowMessage LOGICAL
When TRUE a message is Shown explaining why it is not ok to close the parent form.
Returns LOGICAL
Logical value indicating if it's o.k. to move to the Activated window
Top

PUBLIC RemoveDataLinks ()

Purpose: Removes Data links from all contained SmartDataTargets when the Form
is closed
Notes:



Constructor Detail
Top

PUBLIC SmartWindowFormController (ISmartWindowForm)

Purpose: Constructor for the SmartWindowFormController class
Notes:

Parameters:
poSmartWindowForm Consultingwerk.SmartComponents.Interfaces.ISmartWindowForm
The reference to the ISmartWindowForm that owns this controller


Property Detail
Top

PUBLIC Consultingwerk.SmartComponents.Interfaces.ISmartWindowForm Form


Returns Consultingwerk.SmartComponents.Interfaces.ISmartWindowForm
Top

PUBLIC System.Collections.Generic.List <System.Type> MapEnterKeyControlTypeList


Returns System.Collections.Generic.List <System.Type>
Top

PUBLIC LOGICAL MapEnterKeyToTab


Returns LOGICAL


©2006-2019 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.08.2019 23:32:01