CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    105

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured