TaskList.GetTaskItems Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Quando substituído em uma classe derivada, retorna uma coleção de MethodTaskItem objetos.
public:
abstract System::Collections::ICollection ^ GetTaskItems();
public abstract System.Collections.ICollection GetTaskItems ();
abstract member GetTaskItems : unit -> System.Collections.ICollection
Public MustOverride Function GetTaskItems () As ICollection
Retornos
Uma coleção de MethodTaskItem objetos que é usada por Microsoft.Web.Management
classes para invocar métodos por nome.
Exemplos
/// GetTaskItems() is called every time the context menu is invoked.
public override System.Collections.ICollection GetTaskItems() {
ArrayList items = new ArrayList();
Image imgAsk = rLoadImg.loadImgs(SystemIcons.Asterisk, 16);
Image imgErr = rLoadImg.loadImgs(SystemIcons.Error, 16);
items.Add(new MethodTaskItem(
"DisplayTime", // Method Name
"Show Time", // Menu item Text
"DemoCategory") // Category
);
Person prs = new Person(66, "Joe", "Smith");
MethodTaskItem mti_i = new MethodTaskItem(
"InvTst", // Method Name
"Invoke Test", // Menu item Text
sDemoCat, // Category
"Tool Tip:SC", // ToolTip non-functional
imgAsk, // Menu Icon
prs); // user data
mti_i.CausesNavigation = false;
traceMTI(mti_i);
items.Add(mti_i);
items.Add(new MethodTaskItem(
"ShowCnt", // Method Name
"Show Count", // Menu item Text
sDemoCat, // Category
"Tool Tip:SC", // ToolTip non-functional
mti_i.Image) // Menu Icon
);
}
foreach (TaskItem item in items)
{
if (item is MethodTaskItem)
item.Enabled = true;
}
return items;
}