anchor.diff:      let mutable fileName = ""
       let mutable imageCounter = 1
       let tab = "    "
  +    let actions  = new Hashtable()
  +    let actionsAdditions = new Hashtable()
  +    let triggers = new Hashtable()
  +    let triggersAdditions = new Hashtable()
  +    let usingsBuilder = new StringBuilder()
  +    let xmlnsBuilder = new StringBuilder()
  +    let usings = new Hashtable()
  +    let xmlns = new Hashtable()
       let currentBuilder = new StringBuilder()
  +    let currentAdditionsBuilder = new StringBuilder()
       let builderAppend = append currentBuilder
       let tempStack = new Stack()
       let getNumber (sizeAttr : string) = sizeAttr.Substring(0, sizeAttr.Length - 2)
  -    let loginRequest = new StringBuilder()
  +    let getAttr (nodeName : string) (attrName : string) =
  +        let value = reader.GetAttribute(attrName)
  +        if value = null then raise ( NotFoundAttributeException ("A node \"" + nodeName + "\" doesn't have an attribute " + "\"" + attrName + "\""))
  +        else value
  +    let tryGetAttribute (nodeName : string) (attrName : string) =
  +        try getAttr nodeName attrName
  +        with
  +        | NotFoundAttributeException(str) -> 
  +            printfn "%s" str
  +            exit 2
       try
           while reader.Read() do
               let name = reader.Name
               let depth = reader.Depth
               let depthTab = if depth > 0 then String.replicate (reader.Depth - 1) tab else ""
               match name with
  -            | "application" when reader.NodeType <> XmlNodeType.EndElement -> projectName <- reader.GetAttribute("name")
  +            | "application" when reader.NodeType <> XmlNodeType.EndElement -> 
  +                projectName <- tryGetAttribute name "name"
               | "action" when reader.NodeType <> XmlNodeType.EndElement ->
  -                tempStack.Push(reader.GetAttribute("control-id"))
  +                tempStack.Push(tryGetAttribute name "control-id")
               | "action" when reader.NodeType = XmlNodeType.EndElement ->
                   // ключ - id контрола, значение - код, который нужно выполнить
  -                actions.Add(tempStack.Pop() :?> string, currentBuilder.ToString())
  +                let id = tempStack.Pop() :?> string
  +                actions.Add(id, currentBuilder.ToString())
  +                actionsAdditions.Add(id, currentAdditionsBuilder.ToString())
                   currentBuilder.Clear() |> ignore
  +                currentAdditionsBuilder.Clear() |> ignore
               | "trigger" when reader.NodeType <> XmlNodeType.EndElement ->
  -                tempStack.Push(reader.GetAttribute("event"))
  -                tempStack.Push(reader.GetAttribute("form-id"))
  +                tempStack.Push(tryGetAttribute name "event")
  +                tempStack.Push(tryGetAttribute name "form-id")
               | "trigger" when reader.NodeType = XmlNodeType.EndElement ->
                   // ключ - пара, в которой 1 элемент - имя формы, 2 элемент - событие, занчение - код, который нужно выполнить
                   let formName = tempStack.Pop() :?> string
  -                triggers.Add((formName, tempStack.Pop() :?> string), currentBuilder.ToString())
  +                let event = tempStack.Pop() :?> string;
  +                triggers.Add((formName, event), currentBuilder.ToString())
  +                triggersAdditions.Add((formName, event), currentAdditionsBuilder.ToString())
                   currentBuilder.Clear() |> ignore
  -            | "if" when reader.NodeType <> XmlNodeType.EndElement -> builderAppend <| "\nif (" + reader.GetAttribute("condition") + ")"
  +                currentAdditionsBuilder.Clear() |> ignore
  +            | "if" when reader.NodeType <> XmlNodeType.EndElement -> builderAppend <| "\nif (" + (tryGetAttribute name "condition") + ")"
               | "then" when reader.NodeType <> XmlNodeType.EndElement -> builderAppend <| "\n{"
               | "then" when reader.NodeType = XmlNodeType.EndElement -> builderAppend <| "\n}"
               | "else" when reader.NodeType <> XmlNodeType.EndElement -> builderAppend <| "\nelse\n{"
               | "else" when reader.NodeType = XmlNodeType.EndElement -> builderAppend <| "\n}"
  -            | "transition" -> builderAppend <| "\nNavigationService.Navigate(new Uri(\"/" + reader.GetAttribute("form-id") + ".xaml\", UriKind.Relative));"
  +            | "transition" -> builderAppend <| "\nNavigationService.Navigate(new Uri(\"/" + (tryGetAttribute name "form-id") + ".xaml\", UriKind.Relative));"
               | "login-request" -> 
  -                builderAppend <| ("\nHttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create(\"" + reader.GetAttribute("url") + "\");
  +                builderAppend <| ("\nHttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create(\"" + (tryGetAttribute name "url") + "\");
   myRequest.Method = \"POST\";
   myRequest.ContentType = \"application/x-www-form-urlencoded\";
   myRequest.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), myRequest);") 
  -                append loginRequest <| "\nprivate void GetRequestStreamCallback(IAsyncResult callbackResult)
  +                append currentAdditionsBuilder <| "\nprivate void GetRequestStreamCallback(IAsyncResult callbackResult)
   {
       HttpWebRequest myRequest = (HttpWebRequest)callbackResult.AsyncState;
       Stream postStream = myRequest.EndGetRequestStream(callbackResult);
   
  -    string postData = \"login=\"+" + reader.GetAttribute("login-id") + ".Text + \"&password=\" + " + reader.GetAttribute("password-id") + ".Text;
  +    string postData = \"login=\"+" + (tryGetAttribute name "login-id") + ".Text + \"&password=\" + " + (tryGetAttribute name"password-id") + ".Text;
       byte[] byteArray = Encoding.UTF8.GetBytes(postData);
   
       postStream.Write(byteArray, 0, byteArray.Length);
  
positive.code: using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  using Microsoft.Phone.Controls;" + usings.ToString() + "\nnamespace " + projectName + "
  {
  public partial class " + fileName + ": PhoneApplicationPage
  {\n"
  
negative.code:         printfn "%s" <| so.ReadToEnd()
          match proc.ExitCode with
          | 0 -> ()
          | x -> 
              printfn "%s exited with code %d" name x
              exit x
      // Путь до msbuild должен быть прописан в перменную среды PATH
      start ("cd /d " + path + " & msbuild " + projectName + ".csproj") "msbuild"
  
  