public function isValid(Request $request)
    {
        $arguments = $this->method === "GET" ? $request->get : $request->post;
        $files = $request->files;

        if (!$this->validate($arguments, $files))
            return false;

        $params = ['form' => $this, 'request' => $request, 'valid' => true, 'arguments' => $arguments];
        $params = TypedDictionary::wrap($params);
        $params->setType('errors', Type::ARRAY);
        $result = Hook::execute('Wedeto.HTTP.Forms.Form.isValid', $params);

        if (!$result['valid'])
        {
            foreach ($result['errors'] as $field => $errors)
            {
                if ($errors instanceof Dictionary)
                    $this->errors[$field] = $errors->toArray();
            }
            return false;
        }

        unset($this->form_elements[Nonce::getParameterName()]);
        unset($this->form_elements['_form_name']);

        return true;
    }