Ejemplo n.º 1
0
 /// <summary>
 /// Initializes the task manager with the property values specified in the configuration file.
 /// </summary>
 /// <param name="node">Node</param>
 public void Initialize(XmlNode node)
 {
     this._taskThreads.Clear();
     foreach (XmlNode node1 in node.ChildNodes)
     {
         if (node1.Name.ToLower() == "thread")
         {
             TaskThread taskThread = new TaskThread(node1);
             this._taskThreads.Add(taskThread);
             foreach (XmlNode node2 in node1.ChildNodes)
             {
                 if (node2.Name.ToLower() == "task")
                 {
                     XmlAttribute attribute = node2.Attributes["type"];
                     Type         taskType  = Type.GetType(attribute.Value);
                     if (taskType != null)
                     {
                         Task task = new Task(taskType, node2);
                         taskThread.AddTask(task);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes the task manager with the property values specified in the configuration file.
 /// </summary>
 /// <param name="node">Node</param>
 public void Initialize(XmlNode node)
 {
     this._taskThreads.Clear();
     foreach (XmlNode node1 in node.ChildNodes)
     {
         if (node1.Name.ToLower() == "thread")
         {
             TaskThread taskThread = new TaskThread(node1);
             this._taskThreads.Add(taskThread);
             foreach (XmlNode node2 in node1.ChildNodes)
             {
                 if (node2.Name.ToLower() == "task")
                 {
                     XmlAttribute attribute = node2.Attributes["type"];
                     Type taskType = Type.GetType(attribute.Value);
                     if (taskType != null)
                     {
                         Task task = new Task(taskType, node2);
                         taskThread.AddTask(task);
                     }
                 }
             }
         }
     }
 }