- aal-4_src.zip
- csaal
- bin
- Debug
- Release
- bootstrapLoader
- componentManager
- dataHub
- docs
- AAL-1
- CVS
- AAL-2
- AAL-2
- AAL-3
- AAL-4
- aspect oriented programming
- AOP
- CPstyles
- CVS
- notes
- CVS
- Base
- ProxyDelegate
- CVS
- downloads
- MDISample
- MenuImage
- bin
- Debug
- Release
- obj
- Debug
- temp
- TempPE
- Release
- temp
- TempPE
- MenuImageLib
- bin
- Debug
- Release
- obj
- Debug
- temp
- TempPE
- Release
- temp
- TempPE
- Ethernet
- lib
- MenuManager
- testComponent
- webpages
- DataHub
- images
- The Code Project - The Application Automation Layer - The Data Hub Implementation - C# Programming_files
- WindowFormManager
- worflowManagerManagedThreadPool.cs
- workflowManager
|
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace AAL
{
public abstract class AALForm
{
protected FormMgr formMgr;
protected FormInfo formInfo;
protected Hashtable ctrlList;
protected ArrayList containerControls;
public string DataDomain
{
get
{
if (formInfo.dataDomain != "")
{
return formInfo.dataDomain+".";
}
else
{
return "";
}
}
}
public FormInfo FormInfo
{
get
{
return formInfo;
}
}
public AALControl this[string name]
{
get
{
AALControl ctrl=ctrlList[name] as AALControl;
Dbg.Assert(ctrl != null, new DbgKey("UnkCtrl"), name);
return ctrl;
}
}
public StatusBarPanel MenuHelpPanel
{
set
{
formMgr.MenuHelpForm=this;
IForm.MenuHelpPanel=value;
}
}
public AALForm(FormInfo fi, FormMgr mgr)
{
formInfo=fi;
formMgr=mgr;
ctrlList=new Hashtable();
containerControls=new ArrayList();
formMgr.IDH.CreateWorkflowDomain(fi.dataDomain);
}
public void PreCreateEvent()
{
EventData ev=EventData.Marshal(new MED[] {new MED("Function", formInfo.preCreateEvent)});
formMgr.ICM.Invoke(formInfo.preCreateEvent, null);
}
public void PostCreateEvent()
{
EventData ev=EventData.Marshal(new MED[] {new MED("Function", formInfo.postCreateEvent)});
formMgr.ICM.Invoke(formInfo.preCreateEvent, null);
}
public virtual void Show()
{
}
public virtual void Remove()
{
formMgr.IDH.CreateWorkflowDomain(formInfo.dataDomain);
}
public abstract IForm IForm {get;}
public void AssignMenu(MainMenu menu)
{
IForm.AssignMenu(menu);
}
public void AddControl(string name, AALControl ctrl)
{
ctrlList[name]=ctrl;
}
public void AddContainerControl(AALControl ctrl)
{
containerControls.Add(ctrl);
}
public AALControl FindContainingControl(AALControl ctrl)
{
for (int i=0; i<containerControls.Count; i++)
{
Control c=((AALControl)containerControls[i]).sysctrl;
if ( (c.Location.X <= ctrl.sysctrl.Location.X) &&
(c.Location.Y <= ctrl.sysctrl.Location.Y) &&
(c.Location.X+c.Size.Width >= ctrl.sysctrl.Location.X) &&
(c.Location.Y+c.Size.Height >= ctrl.sysctrl.Location.Y) )
{
return (AALControl)containerControls[i];
}
}
return null;
}
public void SetMenuHelpText(string text)
{
IForm.SetMenuHelpText(text);
}
public void CreateContainerControls()
{
for (int i=0; i<containerControls.Count; i++)
{
AALControl ctrl=(AALControl)containerControls[i];
ctrl.Create();
IForm.AddControl(ctrl);
ctrl.PostCreate();
ControlInfo ci=ctrl.ctrlInfo;
ci.SetupFont(ctrl.sysctrl);
ci.SetupAnchor(ctrl.sysctrl);
// ctrl.sysctrl.Parent=IForm.Form;
// IForm.AddContainerControl(ctrl);
}
}
public void CreateControls()
{
IEnumerator iter=ctrlList.Values.GetEnumerator();
while (iter.MoveNext())
{
AALControl ctrl=iter.Current as AALControl;
if (ctrl.IsSimpleContainer)
{
// skip container control creation, as this is already done
continue;
}
// ********************
ctrl.Create();
IForm.AddControl(ctrl);
ctrl.PostCreate();
// ********************
ControlInfo ci=ctrl.ctrlInfo;
ci.SetupFont(ctrl.sysctrl);
ci.SetupAnchor(ctrl.sysctrl);
if (ci.tooltipText != "")
{
ToolTip tp=new ToolTip();
tp.SetToolTip(ctrl.sysctrl, ci.tooltipText);
}
}
}
public void UpdateStorage()
{
IEnumerator iter=ctrlList.Values.GetEnumerator();
while (iter.MoveNext())
{
AALControl ctrl=iter.Current as AALControl;
ctrl.UpdateStorage();
}
}
public void UpdateStorage(string ctrlName)
{
Dbg.Assert(ctrlList.Contains(ctrlName), new DbgKey("UnkCtrl"), ctrlName);
((AALControl)ctrlList[ctrlName]).UpdateStorage();
}
public void UpdateControl(string ctrlName)
{
Dbg.Assert(ctrlList.Contains(ctrlName), new DbgKey("UnkCtrl"), ctrlName);
((AALControl)ctrlList[ctrlName]).UpdateControl();
}
public void UpdateControlList(string ctrlName)
{
Dbg.Assert(ctrlList.Contains(ctrlName), new DbgKey("UnkCtrl"), ctrlName);
((AALControl)ctrlList[ctrlName]).UpdateControlList();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here