Hi!
Can some one fix this problem? plz!
---
I have a class that descripted as the followings:
public class Commands
{
[CommandMethod("CommandName", "commandGroup", CommandFlags.Modal | CommandFlags.UsePickSet)]
public method method1()
{
}
public method method2(){}
...
}
In method1, I need some information that retrieved from an instance of other class. So I have defined a base class like this one:
public class CommandBased
{
public CommandBased()
{ }
private string commandShortcut;
private string commandTags;
private string commandDesctiption;
public string CommandShortcut
{
get { return commandShortcut; }
set { commandShortcut = value; }
}
public string CommandTags
{
get { return commandTags; }
set { commandTags = value; }
}
public string CommandDesctiption
{
get { return commandDesctiption; }
set { commandDesctiption = value; }
}
#region public methods
public string GenerateCommandInfo()
{
return CommandShortcut + "," + CommandTags + "," + CommandDesctiption;
}
#endregion
}
Back to class Commands above, I want to create an instance of CommandBased, set some value for it, eg:
CommandBased thisCommand = new CommandBased
{
CommandShortcut = "XXX",
CommandTags = "this is tags",
CommandDesctiption = "this is a description"
};
then I want to use it's public method (GenerateCommandInfo method) in CommandMethod:
[CommandMethod(thisCommand.GenerateCommandInfo, "commandGroup", CommandFlags.Modal | CommandFlags.UsePickSet)]
public method method1()
{
}
THE QUESTION: HOW CAN I USE: The question: How can i use:[CommandMethod(thisCommand.GenerateCommandInfo,.......
Thanks!