Windows Phone Developers

Tuesday, July 29, 2008

Property without a 'ReadOnly' or 'WriteOnly' specifier must provide both a 'Get' and a 'Set'

Property without a 'ReadOnly' or 'WriteOnly' specifier must provide both a 'Get' and a 'Set'

If a property is not declared as ReadOnly or WriteOnly, it must supply procedures for reading and writing its value.

Error ID: BC30124




The error comes in the following example as ‘Set’ procedure is not available

Public Property MyTaskPane() As Microsoft.Office.Tools.CustomTaskPane

Get

Return oTaskPane

End Get

End Property

To correct

1. Make sure you include both a Get procedure and a Set procedure between the Property statement and the End Property statement.

2. Verify that other procedures within the Property declaration are correctly terminated.

In the above example, the TaskPane is not set and hence it can be a read-only property

Public ReadOnly Property MyTaskPane() As Microsoft.Office.Tools.CustomTaskPane

Get

Return oTaskPane

End Get

End Property


Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment