Example #1
0
		/// <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;
		}
Example #2
0
        /// <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;
        }
Example #3
0
		public AttachedDocumentSummary CreateAttachedDocumentSummary(AttachedDocument doc)
		{
			var summary = new AttachedDocumentSummary();

			UpdateAttachedDocumentSummary(doc, summary);

			return summary;
		}
Example #4
0
		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;
		}
Example #5
0
		/// <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;
		}
Example #6
0
        /// <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);
        }