Harlan Messinger
2009-08-26 17:02:17 UTC
In Visual Studio 2008, I want to create some extended form controls that
persist their values--that is, they should read their initial values
from the Windows registry and write their final values to the registry.
The general idea is that there would be five properties governing where
the data is saved:
MachineWide (integer, 0 or 1)
Organization (string)
Application (string)
Configuration (string)
Item (string)
The idea is that if the MachineWide property is set to 0 then the data
item will be stored in a data item whose name is the value of the Item
parameter under the key
HKCU\Software\[Organization]\[Application]\[Configuration]. If
MachineWide = 1, then it would be under HKLM instead.
I want multiple controls in an application to be able to save their data
under HKCU\[Organization]\[Application]. Ideally, I would like some
OTHER kind of control to hold the MachineWide, Organization, and
Application properties, so I only have to set those once for the whole
application, and then the other custom controls can point to this control.
I guess this is the same idea as adding a database connection control to
a form, and then having all the data-bound controls point to it.
What is this kind of master control called? Where can I find information
on designing one in my project?
Is there a way to have such a master control in one place for the entire
project, instead of having to add one all over again to each form where
my data-persisting controls are going to be?
persist their values--that is, they should read their initial values
from the Windows registry and write their final values to the registry.
The general idea is that there would be five properties governing where
the data is saved:
MachineWide (integer, 0 or 1)
Organization (string)
Application (string)
Configuration (string)
Item (string)
The idea is that if the MachineWide property is set to 0 then the data
item will be stored in a data item whose name is the value of the Item
parameter under the key
HKCU\Software\[Organization]\[Application]\[Configuration]. If
MachineWide = 1, then it would be under HKLM instead.
I want multiple controls in an application to be able to save their data
under HKCU\[Organization]\[Application]. Ideally, I would like some
OTHER kind of control to hold the MachineWide, Organization, and
Application properties, so I only have to set those once for the whole
application, and then the other custom controls can point to this control.
I guess this is the same idea as adding a database connection control to
a form, and then having all the data-bound controls point to it.
What is this kind of master control called? Where can I find information
on designing one in my project?
Is there a way to have such a master control in one place for the entire
project, instead of having to add one all over again to each form where
my data-persisting controls are going to be?