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

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

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

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

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

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

<p>直接用下式肯定不行了:</p>
<p>&lt;CommandMethod("CopyObj", CommandFlags.Session,CommandFlags.UsePickSet)&gt; _<br/>&nbsp;&nbsp;&nbsp; Public Sub CopyObjects()</p>
<p>不知是否有解决方法?</p>
<p>&nbsp;</p>

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

c#:CommandFlags.Session|CommandFlags.UsePickSet

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

<p>完美解决了,VB.net采用 “+”</p>
<p>&nbsp; &lt;CommandMethod("CopyObj", CommandFlags.Session + CommandFlags.UsePickSet)&gt; _</p>
<p>谢谢各位的帮助!!</p>

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

<font face="Verdana">public CommandMethodAttribute(string globalName);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string globalName, CommandFlags flags);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string groupName, string globalName, CommandFlags flags);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, string helpTopic);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType, string helpFileName, string helpTopic);</font>

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

<div id="textstyle_3" style="FONT-SIZE: 12pt; OVERFLOW: hidden; WORD-BREAK: break-all; TEXT-INDENT: 0px; WORD-WRAP: break-word">学习了!谢谢! </div>
页: [1]
查看完整版本: 请教CommandMethod属性可以有几个参数