|
-
February 22nd, 2010, 05:57 PM
#1
Property Bag Conversion
Hi,
I have some converted VB 6 to C# code that used the property bag to store user control settings. How can I convert the following the read statement to correctly work:
Code:
private void userControl_ReadProperties( UpgradeStubs.VBRUN_PropertyBag propbag)
{
//UPGRADE_ISSUE: (2064) PropertyBag method PropBag.ReadProperty was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
this.Color = ColorTranslator.FromOle(DefaultPropHelper.GetDefaultProperty<int>(propbag.ReadProperty("Color", ColorTranslator.ToOle(K_DEFAULT_COLOR))));
//UPGRADE_ISSUE: (2064) PropertyBag method PropBag.ReadProperty was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
Enabled = DefaultPropHelper.GetDefaultProperty<bool>(propbag.ReadProperty("Enabled", true));
//UPGRADE_WARNING: (6021) Casting 'Variant' to Enum may cause different behaviour. More Information: http://www.vbtonet.com/ewis/ewi6021.aspx
//UPGRADE_ISSUE: (2064) PropertyBag method PropBag.ReadProperty was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
Direction = (enDirection) DefaultPropHelper.GetDefaultProperty<int>(propbag.ReadProperty("Direction", true));
}
Thanks,
LB
Last edited by lbargers; February 22nd, 2010 at 06:00 PM.
-
February 23rd, 2010, 05:32 PM
#2
Re: Property Bag Conversion
 Originally Posted by lbargers
Hi,
I have some converted VB 6 to C# code that used the property bag to store user control settings. How can I convert the following the read statement to correctly work:...
Simple create a class for your data and store that class using XML Reader/Writer this will save the data in a textfile and you can reload them when starting the program. You also may use the settings for your data and simple use
Code:
Properties.Settings.Default.Save();
This should not be too complicated at way.
 Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|