zcmfk 发表于 2010-10-13 10:12:00

请教CommandMethod属性可以有几个参数

各位:
    在生成 运行在程序级的命令时,需前期选取对象,又要实现文档间复制即程序级命令,如在 CommandMethod属性只能有1个参数,则无法同时完成以上两者功能。
    现请问: CommandMethod属性可以有几个参数吗?即 CommandFlags.UsePickSet和 CommandFlags.Session同时存在于CommandMethod属性中。谢谢!!

雪山飞狐_lzh 发表于 2010-10-13 19:07:00

没这样试过,你可以试试用或运算连接两种模式
不过应该是不成的

zcmfk 发表于 2010-10-14 08:46:00

直接用下式肯定不行了:
_
    Public Sub CopyObjects()
不知是否有解决方法?

sieben 发表于 2010-10-14 13:14:00

c#:CommandFlags.Session|CommandFlags.UsePickSet

zcmfk 发表于 2010-10-15 09:26:00

完美解决了,VB.net采用 “+”
   _
谢谢各位的帮助!!

danding198 发表于 2010-10-21 11:22:00

public CommandMethodAttribute(string globalName);
      public CommandMethodAttribute(string globalName, CommandFlags flags);
      public CommandMethodAttribute(string groupName, string globalName, CommandFlags flags);
      public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags);
      public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, string helpTopic);
      public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType);
      public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType, string helpFileName, string helpTopic);

chpmould 发表于 2010-11-7 21:10:00

学习了!谢谢!
页: [1]
查看完整版本: 请教CommandMethod属性可以有几个参数