public FileNewCopyResponse FileNewCopy(
            string filePath,
            long fileID,
            bool isFileShared,
            string message,
            string[] emailsToNotify)
        {
            string destinationUrl = string.Format(FILE_NEW_COPY_URI_TEMPLATE, _token, fileID);
            MultipartWebRequest request = new MultipartWebRequest(destinationUrl, Proxy);
            FileNewCopyResponse response;

            try
            {
                string serverResponse = request.SubmitFiles(new[] { filePath }, isFileShared, message, emailsToNotify);
                response = MessageParser.Instance.ParseFileNewCopyResponseMessage(serverResponse);
            }
            catch (Exception ex)
            {
                response = new FileNewCopyResponse
                {
                    Error = ex,
                    Status = FileNewCopyStatus.Failed
                };
            }

            return response;
        }
Exemplo n.º 2
0
        internal FileNewCopyResponse ParseFileNewCopyResponseMessage(string message)
        {
            FileNewCopyResponse response = new FileNewCopyResponse();
            XDocument doc = XDocument.Parse(message);

            XElement statusElement = GetStatusElement(doc.Root);

            response.Status = ParseFileNewCopyStatus(statusElement.Value);

            return response;
        }