Application settings

Topics: CAB & Smart Client Software Factory
Aug 26, 2007 at 12:44 PM
Hi.
I've Smart Client MDI application. I need to set to every child window some application settings like location or size.

What's a good pattern?

Thanks,
Ejik
Developer
Sep 7, 2007 at 7:51 PM
We are not aware of any special pattern for arranging MDI windows. However, as in any MDI .NET application, you can use the following methods to arrange the child Windows as you typically do in many Windows applications:

this.LayoutMdi(MdiLayout.Cascade);
this.LayoutMdi(MdiLayout.TileHorizontal);
this.LayoutMdi(MdiLayout.TileVertical);
this.LayoutMdi(MdiLayout.ArrangeIcons);
Please let me know if this helps!

Mariano Converti
http://staff.southworks.net/blogs/mconverti/
Sep 9, 2007 at 9:03 AM
Mariano, thanks!!!
Sorry fo my bad english
I've such solve.
1) I've set to _LayoutView some application settings: location and size.
app.config file :

--------------
<setting name="TreeLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="TreeSize" serializeAs="String">
<value>500, 800</value>
</setting>
--------------

2) on ParentForm_FormClosing method
{
Settings.Default.TreeLocation = workItem.ParentForm.Location;
Settings.Default.TreeSize = workItem.ParentForm.Size;
Settings.Default.Save();
}

3) LayoutView realizes ISmartPartInfoProvider interface:
ISmartPartInfo ISmartPartInfoProvider.GetSmartPartInfo(Type smartPartInfoType)
{
...
_LayoutView.Location = this.Location;
_LayoutView.Height = this.Height;
_LayoutView.Width = this.Width;
...
}

Everything works fine. But, my project has a lot of business modules with views and there're need to do this work every time.
I think how to optimize it process now.