Declaring private classes in the thisaddin.vb module

Started by Visisthebest, May 19, 2021, 08:53:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

When declaring simple classes that I use as pure data objects in a list (to execute a DropMany later), for instance:

Private Class ShapeDropToDoItem
    Public MasterToDrop As Visio.Master
    Public X As Double
    Public Y As Double
End Class

I find that I can declare this class as Public but not as Private (even though I do not want to use this class outside the thisaddin.vb module.

When I use Private rather than Public, I get this error:
Error   BC31089   Types declared 'Private' must be inside another type.

Why do I get this error and how can I solve it?
Visio 2021 Professional

Visisthebest

I guess I need to declare it as a Friend class.
Visio 2021 Professional