/// <summary> /// Copy constructor that creates either an exact copy, or an "unprocessed" copy. /// </summary> /// <param name="source"></param> /// <param name="unprocessed"></param> protected AttachedDocument(AttachedDocument source, bool unprocessed) { _creationTime = unprocessed ? Platform.Time : source.CreationTime; _mimeType = source.MimeType; _fileExtension = source.FileExtension; _contentUrl = source.ContentUrl; }
public AttachedDocumentSummary CreateAttachedDocumentSummary(AttachedDocument doc) { var summary = new AttachedDocumentSummary(); UpdateAttachedDocumentSummary(doc, summary); return summary; }
public void UpdateAttachedDocumentSummary(AttachedDocument doc, AttachedDocumentSummary summary) { summary.DocumentRef = doc.GetRef(); summary.CreationTime = doc.CreationTime; summary.ReceivedTime = doc.DocumentReceivedTime; summary.MimeType = doc.MimeType; summary.ContentUrl = doc.ContentUrl; summary.FileExtension = doc.FileExtension; summary.DocumentHeaders = new Dictionary<string, string>(doc.DocumentHeaders); summary.DocumentTypeName = doc.DocumentTypeName; }
/// <summary> /// Creates a <see cref="AttachedDocument"/> instance, uploading the specified file to the document store. /// </summary> /// <param name="args"></param> /// <param name="documentStore"></param> /// <returns></returns> public static AttachedDocument Create(AttachedDocumentCreationArgs args, IAttachedDocumentStore documentStore) { // create the new document object, and put the remote file var document = new AttachedDocument { MimeType = args.MimeType, FileExtension = args.FileExtension, }; document.PutFile(documentStore, args.LocalContentFilePath); return document; }
/// <summary> /// Creates a <see cref="AttachedDocument"/> instance, uploading the specified file to the document store. /// </summary> /// <param name="args"></param> /// <param name="documentStore"></param> /// <returns></returns> public static AttachedDocument Create(AttachedDocumentCreationArgs args, IAttachedDocumentStore documentStore) { // create the new document object, and put the remote file var document = new AttachedDocument { MimeType = args.MimeType, FileExtension = args.FileExtension, }; document.PutFile(documentStore, args.LocalContentFilePath); return(document); }