枚举的访问级别 [英] Access Level for Enum

查看:39
本文介绍了枚举的访问级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DLL项目,它有几个类和一个全局模块。全局模块具有公共枚举。我在类中有一个Public Function,我希望Public Enum成为函数中的参数。但是我得到一个蓝色波浪形的错误:



'MyEnumNameInstance'不能通过类'MyClassName在项目外公开类型'[Global} .MyEnumName' '。



在我声明我的功能的代码中:

I have a DLL project that has several classes and a global module. The global module has a Public Enum. I have a Public Function in a class and I want the Public Enum to be a parameter in the function. But I get a blue squiggly error:

'MyEnumNameInstance' cannot expose type '[Global}.MyEnumName' outside the project through class 'MyClassName'.

At the point in the code where I declare my function:

Public Function MyFunction(ByVal MyEnumNameInstance As MyEnumName, _
                           ByVal otherParm As Integer) As Boolean
    'Function does stuff then returns boolean
End Function







不是那样的什么公共应该做什么?如何将枚举更公开,而不仅仅是公开?我真的不想在我的DLL中的每个类中复制枚举。重点是枚举的一个定义,它在任何地方都使用。是否存在一个关键字,即使在dll之外也可以公开?




Isn't that what "Public" is supposed to do? How can I make an enumeration MORE public than just declaring it Public? I don't really want to copy the enumeration across every class in my DLL. The whole point is to have one definition of the enumeration and it is used everywhere. Is there a keyword that can make it public even outside the dll?

推荐答案

正如评论中所提到的,链中某处某些东西不公开。应该是MyEnumNameInstance。
As mentioned in the comments, somewhere in the chain something is not public. Should be MyEnumNameInstance.


仅回答删除表单未答复列表:由OP解决。
Answered only to remove form unanswered list: solved by OP.


这篇关于枚举的访问级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆