TaskList Construtor
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.
Inicializa uma nova instância da classe TaskList.
protected:
TaskList();
protected TaskList ();
Protected Sub New ()
Exemplos
O exemplo a seguir mostra um método substituído Tasks que é chamado por um membro privado da HierarchyProvider classe quando o menu de atalho é ativado no nó.
internal class DemoHierProvidr : HierarchyProvider
{
private DemoHierarchyInfo _info;
public DemoHierProvidr(IServiceProvider serviceProvider)
: base(serviceProvider)
{
}
internal class DemoHierarchyInfo : HierarchyInfo
{
private static string sMachine = "Machine";
private static string sOS = "OSVersion";
static string sPerformance = "Performance";
private static string sDemoCat = sPerformance; // "DemoCategory";
private static string sUDemoH = "UltraDemo";
private System.Collections.IDictionary _dhDict;
private string _sNodeName;
private bool _navSimp = false;
private System.IO.FileStream _objStrm;
HierarchyDemoInfoTaskList _dhTaskList;
public override TaskListCollection Tasks
{
get
{
TaskListCollection tlc = base.Tasks;
if (_dhTaskList == null)
{
_dhTaskList = new HierarchyDemoInfoTaskList(this);
}
tlc.Insert(0, _dhTaskList);
return tlc;
}
}
private sealed class HierarchyDemoInfoTaskList : TaskList
{
private DemoHierarchyInfo _owner;
private bool _dirtyState = false;
Person _curPerson = new Person(23, "Albert", "Smith");
public HierarchyDemoInfoTaskList(DemoHierarchyInfo owner) {
_owner = owner;
}
public void Delete()
{
_owner.Delete();
}
Comentários
O construtor geralmente é chamado indiretamente por uma classe que contém que implementa a IServiceProvider interface .