Как прибавить необходимое число к MaxNumOfSuccesStop?

caine

Client
Регистрация
29.11.2011
Сообщения
28
Благодарностей
1
Баллы
3
а не заменить на новое, как в в этом коде
Код:
var searchName = "Register";
var searchResult = false;

// get the task list from the ZennoPoster
var tasks = ZennoPoster.TasksList;
foreach (var tsk in tasks)
{
    // loading Xml documnt with task content
    var doc = new System.Xml.XmlDocument();
    doc.LoadXml("<Task>" + tsk + "</Task>");

    // Search task by name
    var nameElement = doc.SelectSingleNode("Task/Name");
    if(nameElement == null) continue;
    var name = nameElement.InnerText;
    // if we found our task
    if (name == searchName)
    {
        // take task id
        var idElement = doc.SelectSingleNode("Task/Id");
        if (idElement == null) continue;
        var id = Guid.Parse(idElement.InnerText);

        // take execution settings element
        var esElement = doc.SelectSingleNode("Task/ExecutionSettings");
        if (esElement == null) continue;

        // take limit of threads of the task
        var threadsElement = doc.SelectSingleNode("Task/ExecutionSettings/MaxNumOfSuccesStop");
        if (threadsElement == null) continue;
      
        // change the value
        threadsElement.InnerText = "1055";

        // set new settings
        ZennoPoster.SetExecutionSettings(id, esElement.InnerXml);
      
        {
            // take execution settings element
        var esElement1 = doc.SelectSingleNode("Task/ExecutionSettings");
        if (esElement1 == null) continue;

        // take limit of threads of the task
        var threadsElement1 = doc.SelectSingleNode("Task/ExecutionSettings/NumberOfTries");
        if (threadsElement1 == null) continue;
      
        // change the value
        threadsElement1.InnerText = project.Variables["rowCount"].Value;

        // set new settings
        ZennoPoster.SetExecutionSettings(id, esElement1.InnerXml);
        }
      
      
        searchResult = true;
        break;
    }
}
if (!searchResult)
    throw new Exception("Task " + searchName + " not found!");
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)