Implementing MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl


Author
Message
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
I've got an existing form that I need to add MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl support, that is:

public partial class SearchForm : Form, IFormHelper, MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl



What methods do I need to add to make the "does not implement interface member" errors go away.

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you hover over the interface name on the inherits declaration, you should be the little "block" at the bottom, right-hand corner of the interface name.  When you put your mouse over the block, you'll get a menu that you can open up.  That menu should have an option that says "Implement Interface Explicitly," which will create the necessary member stubs for you.

The best way to make sure you implement it properly is to open up the BaseForm.vb file and use the implementation from that file.

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
The code for adding the IContainerControl interface to your existing form is this:

#region IContainerControl Members

private MicroFour.StrataFrame.Business.BusinessObjectCollection _BusinessObjects = new MicroFour.StrataFrame.Business.BusinessObjectCollection();
private List<MicroFour.StrataFrame.UI.IInitOnFormLoad> _ObjectsToInitOnLoad = new List<MicroFour.StrataFrame.UI.IInitOnFormLoad>();
private List<MicroFour.StrataFrame.UI.IPreInitOnFormLoad> _ObjectsToPreInitOnLoad = new List<MicroFour.StrataFrame.UI.IPreInitOnFormLoad>();

void MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl.AddBusinessObject(MicroFour.StrataFrame.Business.BusinessLayerBase BusinessObject)
{
this._BusinessObjects.Add(BusinessObject);
}

void MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl.AddObjectToInitOnLoad(MicroFour.StrataFrame.UI.IInitOnFormLoad ObjectToInit)
{
this._ObjectsToInitOnLoad.Add(ObjectToInit);
}

void MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl.AddObjectToPreInitOnLoad(MicroFour.StrataFrame.UI.IPreInitOnFormLoad ObjectToPreInit)
{
this._ObjectsToPreInitOnLoad.Add(ObjectToPreInit);
}

void MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl.RemoveBusinessObject(MicroFour.StrataFrame.Business.BusinessLayerBase BusinessObject)
{
this._BusinessObjects.Remove(BusinessObject);
}

#endregion


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
That code will not add the functionality for the business objects to initialize themselves when the form loads, but it will add them to the form's business objects collection.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search