Exemplo n.º 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)
         );
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }