示例#1
0
 /// <summary>
 /// Return all document source fields in this context
 /// </summary>
 /// <returns></returns>
 public IEnumerable <DocumentSource> GetDocumentSources()
 {
     return(
         from fieldValue in this.GetValueForField(FieldNames.DocumentSource)
         select DocumentSource.Deserialize(fieldValue)
         );
 }
示例#2
0
        /// <summary>
        /// Add a new document source to the context
        /// </summary>
        /// <param name="source"></param>
        public void Add(DocumentSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            string fieldValue = source.ToString();

            this.Add(FieldNames.DocumentSource, fieldValue);
        }
示例#3
0
        /// <summary>
        /// Compare two document sources
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public int CompareTo(DocumentSource other)
        {
            if (other == null)
            {
                return(1);
            }

            int cmp = MimeStandard.Comparer.Compare(this.DocumentName, other.DocumentName);

            if (cmp == 0)
            {
                cmp = MimeStandard.Comparer.Compare(this.Source, other.Source);
            }

            return(cmp);
        }