Exemplo n.º 1
0
        public static OCRQueueMessage Parse(string messageString)
        {
            var splitString = messageString.Split('|');
            var jobID = splitString[0];
            string imageBlobName = splitString[1];
            string recipientEmail = splitString[2];

            if (string.IsNullOrEmpty(jobID))
            {
                throw new FormatException("Job ID cannot be empty.");
            }
            if (string.IsNullOrEmpty(imageBlobName))
            {
                throw new FormatException("Image blob name cannot be empty.");
            }
            if (string.IsNullOrEmpty(recipientEmail))
            {
                throw new FormatException("Email address cannot be empty.");
            }

            var message = new OCRQueueMessage(Guid.Parse(jobID), imageBlobName, recipientEmail);
            return message;
        }
Exemplo n.º 2
0
        public static OCRQueueMessage Parse(string messageString)
        {
            var    splitString    = messageString.Split('|');
            var    jobID          = splitString[0];
            string imageBlobName  = splitString[1];
            string recipientEmail = splitString[2];

            if (string.IsNullOrEmpty(jobID))
            {
                throw new FormatException("Job ID cannot be empty.");
            }
            if (string.IsNullOrEmpty(imageBlobName))
            {
                throw new FormatException("Image blob name cannot be empty.");
            }
            if (string.IsNullOrEmpty(recipientEmail))
            {
                throw new FormatException("Email address cannot be empty.");
            }

            var message = new OCRQueueMessage(Guid.Parse(jobID), imageBlobName, recipientEmail);

            return(message);
        }
Exemplo n.º 3
0
 private static void CreateOCRQueueItem(Guid jobID, string blobName, string emailAddress)
 {
     var message = new OCRQueueMessage(jobID, blobName, emailAddress);
     var wrappedMessage = new CloudQueueMessage(message.ToString());
     AzureQueues.OCRQueue.AddMessage(wrappedMessage);
 }