Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Step3 - Tutorial 4 (Read 1982 times)
Christie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Dec 1st, 2006
Step3 - Tutorial 4
Dec 10th, 2006 at 10:41pm
Print Post  
I am busy working through Tutorial 4, using the supplied VB.Net code.  I can't seem to find the equivalent code for  step 3 below where one associate a viewer with the custom item class:

[ItemViewer(typeof(MyAppViewer))]
public class MyApp : Appointment
{
...

My first question is should this code be in the forms load event?
Please list the equivalent VB.Net code for this.

Thanks
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Step3 - Tutorial 4
Reply #1 - Dec 11th, 2006 at 7:21am
Print Post  
This association is actually performed in the next tutorial - Tutorial 5. Here is the VB.NET equivalent code:

Code
Select All
<ItemEditorAttribute(GetType(MyAppEditor))> _
Public Class MyApp
    Inherits Appointment
... 



This code snippet assumes you have already defined the MyAppViewer class.

The code above represents a declaration of a new class (a custom appointment class). This is done because the association of a custom item viewer with an appointment is performed on a class level using attributes and cannot be accomplished at run-time. Therefore, you cannot place it in the form's Load event handler because new classes cannot be declared inside methods. It would be best to place it in a separate file.

I hope this helps.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint