程序集的枚举未显示 [英] Enums from assembly not showing

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

问题描述

我有一个具有枚举和如下方法的程序集:

I have an assembly that has an enum and method like this:

namespace assembly
{
   public enum Myenum
   {
      value1,
      value2,
   }
   public class Myclass{
   {
      public void testMethod(Myenum enumValue)
      {
         //do stuff
      }
   }
}

但是,我无法在第二个程序集中传递参数,因为我的枚举不会显示

However, I'm not able to pass the parameter in the second assembly because my enum wont show

using assembly;

命名空间assembly2 { 公共课程Myclass2 { 公共无效的CallMethod() { 新的Myclass().testMethod(//未显示枚举); } } }

namespace assembly2 { public class Myclass2 { public void CallMethod() { new Myclass().testMethod(//Enum not showing); } } }

我在Visual Studio中引用了程序集,方法可以正常工作,但其中没有枚举.有什么想法吗?

I have the assembly referenced in Visual Studio, and the methods work fine, but the enum is not there. Any ideas?

推荐答案

using assembly;

命名空间assembly2 { 公共课程Myclass2 { 公共无效的CallMethod() { 新的Myclass().testMethod(//未显示枚举); } } }

namespace assembly2 { public class Myclass2 { public void CallMethod() { new Myclass().testMethod(//Enum not showing); } } }

您能否详细说明枚举不显示"是什么意思?从您的代码中,它看起来像在您的"testMethod()"中一样.您需要传递值的方法.

Could you elaborate what do you mean by "Enum not showing"? From your code it looks like in your "testMethod()" method you need to pass value.


这篇关于程序集的枚举未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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