예제 #1
0
        /// <summary>Constructor, given a category as a string from the URI.</summary>
        public QueryCategory(string strCategory, QueryCategoryOperator op) {
            Tracing.TraceMsg("Depersisting category from: " + strCategory);
            this.categoryOperator = op;
            strCategory = FeedQuery.CleanPart(strCategory);

            // let's parse the string
            if (strCategory[0] == '-') {
                // negator
                this.isExcluded = true;
                // remove him
                strCategory = strCategory.Substring(1, strCategory.Length - 1);
            }

            // let's extract the scheme if there is one...
            int iStart = strCategory.IndexOf('{');
            int iEnd = strCategory.IndexOf('}');
            AtomUri scheme = null;
            if (iStart != -1 && iEnd != -1) {
                iEnd++;
                iStart++;
                scheme = new AtomUri(strCategory.Substring(iStart, iEnd - iStart - 1));
                // the rest is then
                strCategory = strCategory.Substring(iEnd, strCategory.Length - iEnd);
            }

            Tracing.TraceMsg("Category found: " + strCategory + " - scheme: " + scheme);

            this.category = new AtomCategory(strCategory, scheme);
        }
        //////////////////////////////////////////////////////////////////////
        /// <summary>Constructor, given a category as a string from the URI.</summary>
        //////////////////////////////////////////////////////////////////////
        public QueryCategory(string strCategory, QueryCategoryOperator op)
        {
            Tracing.TraceMsg("Depersisting category from: " + strCategory);
            this.categoryOperator = op;
            strCategory           = FeedQuery.CleanPart(strCategory);

            // let's parse the string
            if (strCategory[0] == '-')
            {
                // negator
                this.isExcluded = true;
                // remove him
                strCategory = strCategory.Substring(1, strCategory.Length - 1);
            }

            // let's extract the scheme if there is one...
            int     iStart = strCategory.IndexOf('{');
            int     iEnd   = strCategory.IndexOf('}');
            AtomUri scheme = null;

            if (iStart != -1 && iEnd != -1)
            {
                //
                iEnd++;
                iStart++;
                scheme = new AtomUri(strCategory.Substring(iStart, iEnd - iStart - 1));
                // the rest is then
                strCategory = strCategory.Substring(iEnd, strCategory.Length - iEnd);
            }

            Tracing.TraceMsg("Category found: " + strCategory + " - scheme: " + scheme);

            this.category = new AtomCategory(strCategory, scheme);
        }
예제 #3
0
 public void UriTest()
 {
     AtomBaseLink target = CreateAtomBaseLink(); 
     AtomUri expected = new AtomUri("http://www.test.com/");
     AtomUri actual;
     target.Uri = expected;
     actual = target.Uri;
     Assert.AreEqual(expected, actual);
 }
예제 #4
0
        /////////////////////////////////////////////////////////////////////////////
        #endregion


        #region overloaded for property changes, xml:base
        //////////////////////////////////////////////////////////////////////
        /// <summary>just go down the child collections</summary>
        /// <param name="uriBase"> as currently calculated</param>
        //////////////////////////////////////////////////////////////////////
        internal override void BaseUriChanged(AtomUri uriBase)
        {
            base.BaseUriChanged(uriBase);

            foreach (AtomPerson person in this.Authors)
            {
                person.BaseUriChanged(uriBase);
            }
            // saving Contributors
            foreach (AtomPerson person in this.Contributors)
            {
                person.BaseUriChanged(uriBase);
            }
            // saving Categories
            foreach (AtomCategory category in this.Categories)
            {
                category.BaseUriChanged(uriBase);
            }
            // saving the generator
            if (this.Generator != null)
            {
                this.Generator.BaseUriChanged(uriBase);
            }
            // save the icon
            if (this.Icon != null)
            {
                this.Icon.BaseUriChanged(uriBase);
            }
            // save the logo
            if (this.Logo != null)
            {
                this.Logo.BaseUriChanged(uriBase);
            }
            // save the ID
            if (this.Id != null)
            {
                this.Id.BaseUriChanged(uriBase);
            }
            // save the Links
            foreach (AtomLink link in this.Links)
            {
                link.BaseUriChanged(uriBase);
            }

            if (this.Rights != null)
            {
                this.Rights.BaseUriChanged(uriBase);
            }
            if (this.Subtitle != null)
            {
                this.Subtitle.BaseUriChanged(uriBase);
            }
            if (this.Title != null)
            {
                this.Title.BaseUriChanged(uriBase);
            }
        }
예제 #5
0
        /// <summary>just go down the child collections</summary>
        /// <param name="uriBase"> as currently calculated</param>
        internal override void BaseUriChanged(AtomUri uriBase)
        {
            base.BaseUriChanged(uriBase);
            // now pass it to the properties.
            uriBase = new AtomUri(Utilities.CalculateUri(this.Base, uriBase, null));

            if (this.Title != null)
            {
                this.Title.BaseUriChanged(uriBase);
            }

            if (this.Id != null)
            {
                this.Id.BaseUriChanged(uriBase);
            }

            foreach (AtomLink link in this.Links)
            {
                link.BaseUriChanged(uriBase);
            }

            foreach (AtomPerson person in this.Authors)
            {
                person.BaseUriChanged(uriBase);
            }

            foreach (AtomPerson person in this.Contributors)
            {
                person.BaseUriChanged(uriBase);
            }

            foreach (AtomCategory category in this.Categories)
            {
                category.BaseUriChanged(uriBase);
            }

            if (this.Rights != null)
            {
                this.Rights.BaseUriChanged(uriBase);
            }

            if (this.Summary != null)
            {
                this.Summary.BaseUriChanged(uriBase);
            }

            if (this.Content != null)
            {
                this.Content.BaseUriChanged(uriBase);
            }

            if (this.Source != null)
            {
                this.Source.BaseUriChanged(uriBase);
            }
        }
예제 #6
0
 public void ContentTest()
 {
     Uri uri = new Uri("http://www.test.com/");
     AtomUri target = new AtomUri(uri); // TODO: Initialize to an appropriate value
     string expected = "http://www.test.com/";            
     string actual;
     target.Content = expected;
     actual = target.Content;
     Assert.AreEqual(expected, actual);
 }
 /// <summary>comparison method similar to strings</summary>
 public static int Compare(AtomUri oneAtomUri, AtomUri anotherAtomUri)
 {
     if (oneAtomUri != null)
     {
         return(oneAtomUri.CompareTo(anotherAtomUri));
     }
     else if (anotherAtomUri == null)
     {
         return(0);
     }
     return(-1);
 }
예제 #8
0
파일: atomuri.cs 프로젝트: mintwans/cpsc483
 /// <summary>comparison method similar to strings</summary> 
 public static int Compare(AtomUri a, AtomUri b)
 {
     if (a != null) 
     {
         return a.CompareTo(b);
     }
     else if (b == null) 
     {
         return 0;
     }
     return -1; 
 }
예제 #9
0
 /// <summary>comparison method similar to strings</summary> 
 public static int Compare(AtomUri oneAtomUri, AtomUri anotherAtomUri)
 {
     if (oneAtomUri != null) 
     {
         return oneAtomUri.CompareTo(anotherAtomUri);
     }
     else if (anotherAtomUri == null) 
     {
         return 0;
     }
     return -1; 
 }
예제 #10
0
        /////////////////////////////////////////////////////////////////////////////

        #region overloaded for property changes, xml:base
        //////////////////////////////////////////////////////////////////////
        /// <summary>just go down the child collections</summary>
        /// <param name="uriBase"> as currently calculated</param>
        //////////////////////////////////////////////////////////////////////
        internal override void BaseUriChanged(AtomUri uriBase)
        {
            base.BaseUriChanged(uriBase);

            // now walk over the entries and forward...
            uriBase = new AtomUri(Utilities.CalculateUri(this.Base, uriBase, null));

            foreach (AtomEntry entry in this.Entries)
            {
                entry.BaseUriChanged(uriBase);
            }
        }
예제 #11
0
        /// <summary>helper method to encapsulate a string encoding, uses HTML encoding now</summary>
        /// <param name="writer">the xml writer to write to</param>
        /// <param name="content">the string to encode</param>
        static protected void WriteEncodedString(XmlWriter writer, AtomUri content)
        {
            if (writer == null)
            {
                throw new System.ArgumentNullException("writer", "No valid xmlWriter");
            }

            if (Utilities.IsPersistable(content))
            {
                string encoded = Utilities.EncodeString(content.ToString());
                writer.WriteString(encoded);
            }
        }
        //////////////////////////////////////////////////////////////////////
        /// <summary>public static string CalculateUri(string base, string inheritedBase, string local)</summary>
        /// <param name="localBase">the baseUri from xml:base </param>
        /// <param name="inheritedBase">the pushed down baseUri from an outer element</param>
        /// <param name="localUri">the Uri value</param>
        /// <returns>the absolute Uri to use... </returns>
        //////////////////////////////////////////////////////////////////////
        internal static string CalculateUri(AtomUri localBase, AtomUri inheritedBase, string localUri)
        {
            try
            {
                Uri uriBase      = null;
                Uri uriSuperBase = null;
                Uri uriComplete  = null;

                if (inheritedBase != null && inheritedBase.ToString() != null)
                {
                    uriSuperBase = new Uri(inheritedBase.ToString());
                }
                if (localBase != null && localBase.ToString() != null)
                {
                    if (uriSuperBase != null)
                    {
                        uriBase = new Uri(uriSuperBase, localBase.ToString());
                    }
                    else
                    {
                        uriBase = new Uri(localBase.ToString());
                    }
                }
                else
                {
                    // if no local xml:base, take the passed down one
                    uriBase = uriSuperBase;
                }
                if (localUri != null)
                {
                    if (uriBase != null)
                    {
                        uriComplete = new Uri(uriBase, localUri.ToString());
                    }
                    else
                    {
                        uriComplete = new Uri(localUri.ToString());
                    }
                }
                else
                {
                    uriComplete = uriBase;
                }

                return(uriComplete != null ? uriComplete.AbsoluteUri : null);
            }
            catch (System.UriFormatException)
            {
                return("Unsupported URI format");
            }
        }
예제 #13
0
 /// <summary>
 /// finds a category with a given term and scheme
 /// </summary>
 /// <param name="term"></param>
 /// <param name="scheme"></param>
 /// <returns>AtomCategory or NULL</returns>
 public AtomCategory Find(string term, AtomUri scheme)
 {
     foreach (AtomCategory category in List)
     {
         if (scheme == null || scheme == category.Scheme)
         {
             if (term == category.Term)
             {
                 return(category);
             }
         }
     }
     return(null);
 }
예제 #14
0
        /////////////////////////////////////////////////////////////////////////////




        //////////////////////////////////////////////////////////////////////
        /// <summary>This starts the calculation, to push down the base
        /// URI changes.</summary> 
        /// <param name="uriValue">the baseuri calculated so far</param>
        //////////////////////////////////////////////////////////////////////
        internal virtual void BaseUriChanged(AtomUri uriValue)
        {
            // if this is ever getting called explicitly (parsing), we turn on recalc
            this.fAllowRecalc = true;
            this.uriImpliedBase = uriValue;
        }
예제 #15
0
 /// <summary>Little helper that checks if a string is XML persistable</summary> 
 public static bool IsPersistable(AtomUri uriString)
 {
     return uriString == null ? false : Utilities.IsPersistable(uriString.ToString());
 }
예제 #16
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>Category constructor</summary>
        /// <param name="term">the term of the category</param>
        /// <param name="scheme">the scheme of the category</param>
        //////////////////////////////////////////////////////////////////////
        public AtomCategory(string term, AtomUri scheme)
        {
            this.Term   = term;
            this.Scheme = scheme;
        }
예제 #17
0
 /// <summary>This starts the calculation, to push down the base
 /// URI changes.</summary>
 /// <param name="uriValue">the baseuri calculated so far</param>
 internal virtual void BaseUriChanged(AtomUri uriValue)
 {
     // if this is ever getting called explicitly (parsing), we turn on recalc
     this.fAllowRecalc   = true;
     this.uriImpliedBase = uriValue;
 }
예제 #18
0
 public void AbsoluteUriTest()
 {
     AtomBaseLink target = CreateAtomBaseLink(); // TODO: Initialize to an appropriate value
     AtomUri actual = new AtomUri(target.AbsoluteUri);
     Assert.AreEqual(target.Uri, actual);
 }
예제 #19
0
 public void IsPersistableTest()
 {
     AtomUri uriString = new AtomUri("http://www.test.com/");
     bool expected = true; // TODO: Initialize to an appropriate value
     bool actual;
     actual = Utilities.IsPersistable(uriString);
     Assert.AreEqual(expected, actual);
 }
예제 #20
0
 public void BaseTest()
 {
     AtomBase target = CreateAtomBase(); // TODO: Initialize to an appropriate value
     AtomUri expected =new AtomUri("http://www.test.com/");
     AtomUri actual;
     target.Base = expected;
     actual = target.Base;
     Assert.AreEqual(expected, actual);
 }
예제 #21
0
 public void SchemeTest()
 {
     AtomCategory target = new AtomCategory(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("scheme");
     AtomUri actual;
     target.Scheme = expected;
     actual = target.Scheme;
     Assert.AreEqual(expected, actual);
 }
예제 #22
0
 public void AtomCategoryConstructorTest()
 {
     string term = "term";
     AtomUri scheme = new AtomUri("scheme");
     AtomCategory target = new AtomCategory(term, scheme);
     Assert.AreEqual(target.Term, term);
     Assert.AreEqual(target.Scheme.ToString(), "scheme");
 }
예제 #23
0
 public void AbsoluteUriTest()
 {
     AtomLink target = new AtomLink(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("http://www.test.com/");
     target.HRef = expected;
     Assert.AreEqual(target.AbsoluteUri, "http://www.test.com/");
 }
예제 #24
0
 public void HRefTest()
 {
     AtomLink target = new AtomLink(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("http://www.test.com/");
     AtomUri actual;
     target.HRef = expected;
     actual = target.HRef;
     Assert.AreEqual(expected, actual);
 }
예제 #25
0
 public void SrcTest()
 {
     AtomContent target = new AtomContent(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("http://www.test.com/");
     AtomUri actual;
     target.Src = expected;
     actual = target.Src;
     Assert.AreEqual(expected, actual);
 }
예제 #26
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>helper method to encapsulate encoding, uses HTML encoding now</summary> 
        /// <param name="writer">the xml writer to write to</param>
        /// <param name="attributeName">the attribute the write</param>
        /// <param name="content">the atomUri to encode</param>
        //////////////////////////////////////////////////////////////////////
        static protected void WriteEncodedAttributeString(XmlWriter writer, string attributeName, AtomUri content)
        {
            if (writer == null)
            {
                throw new System.ArgumentNullException("writer", "No valid xmlWriter");
            }
            if (attributeName == null)
            {
                throw new System.ArgumentNullException( "attributeName", "No valid attributename");
            }


            if (Utilities.IsPersistable(content))
            {
                string encoded = Utilities.EncodeString(content.ToString());
                writer.WriteAttributeString(attributeName, encoded);
            }
        }
예제 #27
0
        /// <summary>helper method to encapsulate encoding, uses HTML encoding now</summary>
        /// <param name="writer">the xml writer to write to</param>
        /// <param name="elementName">the attribute the write</param>
        /// <param name="content">the string to encode</param>
        static protected void WriteEncodedElementString(XmlWriter writer, string elementName, AtomUri content)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            if (Utilities.IsPersistable(content))
            {
                string encoded = Utilities.EncodeString(content.ToString());
                writer.WriteElementString(elementName, BaseNameTable.NSAtom, encoded);
            }
        }
예제 #28
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>helper method to encapsulate encoding, uses HTML encoding now</summary> 
        /// <param name="writer">the xml writer to write to</param>
        /// <param name="elementName">the attribute the write</param>
        /// <param name="content">the string to encode</param>
        //////////////////////////////////////////////////////////////////////
        static protected void WriteEncodedElementString(XmlWriter writer, string elementName, AtomUri content)
        {
            if (Utilities.IsPersistable(content))
            {
                string encoded = Utilities.EncodeString(content.ToString());
                writer.WriteElementString(elementName, BaseNameTable.NSAtom, encoded); 
            }
        }
예제 #29
0
 public void UriTest()
 {
     AtomGenerator target = new AtomGenerator(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("http://www.test.com/");
     AtomUri actual;
     target.Uri = expected;
     actual = target.Uri;
     Assert.AreEqual(expected, actual);
 }
예제 #30
0
        /// <summary>just go down the child collections</summary> 
        /// <param name="uriBase"> as currently calculated</param>
        internal override void BaseUriChanged(AtomUri uriBase) {
            base.BaseUriChanged(uriBase);
            // now pass it to the properties.
            uriBase = new AtomUri(Utilities.CalculateUri(this.Base, uriBase, null));

            if (this.Title != null) {
                this.Title.BaseUriChanged(uriBase);
            }

            if (this.Id != null) {
                this.Id.BaseUriChanged(uriBase);
            }

            foreach (AtomLink link in this.Links) {
                link.BaseUriChanged(uriBase);
            }

            foreach (AtomPerson person in this.Authors) {
                person.BaseUriChanged(uriBase);
            }

            foreach (AtomPerson person in this.Contributors) {
                person.BaseUriChanged(uriBase);
            }

            foreach (AtomCategory category in this.Categories) {
                category.BaseUriChanged(uriBase);
            }

            if (this.Rights != null) {
                this.Rights.BaseUriChanged(uriBase);
            }

            if (this.Summary != null) {
                this.Summary.BaseUriChanged(uriBase);
            }

            if (this.Content != null) {
                this.Content.BaseUriChanged(uriBase);
            }

            if (this.Source != null) {
                this.Source.BaseUriChanged(uriBase);
            }
        }
예제 #31
0
 public void op_InequalityTest()
 {
     AtomUri a = new AtomUri("A");
     AtomUri b = new AtomUri("B");
     bool expected = true; // TODO: Initialize to an appropriate value
     bool actual;
     actual = (a != b);
     Assert.AreEqual(expected, actual);
 }
예제 #32
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>Category constructor</summary>
        /// <param name="term">the term of the category</param>
        /// <param name="scheme">the scheme of the category</param>
        /// <param name="label"> the label for the category</param>
        //////////////////////////////////////////////////////////////////////
        public AtomCategory(string term, AtomUri scheme, string label)
        {
            this.Term   = term;
            this.Scheme = scheme;
            this.label  = label;
        }
예제 #33
0
 public void AbsoluteUriTest()
 {
     AtomContent target = new AtomContent(); // TODO: Initialize to an appropriate value
     AtomUri expected = new AtomUri("http://www.test.com/");
     target.Src = expected;
     string actual;
     actual = target.AbsoluteUri;
     Assert.AreEqual(actual, "http://www.test.com/");
 }
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>Category constructor</summary> 
        /// <param name="term">the term of the category</param>
        /// <param name="scheme">the scheme of the category</param>
        //////////////////////////////////////////////////////////////////////
        public AtomCategory(string term, AtomUri scheme)
        {
            this.Term = term;
            this.Scheme = scheme; 
        }
예제 #35
0
        /////////////////////////////////////////////////////////////////////////////

#region overloaded for property changes, xml:base
        //////////////////////////////////////////////////////////////////////
        /// <summary>just go down the child collections</summary> 
        /// <param name="uriBase"> as currently calculated</param>
        //////////////////////////////////////////////////////////////////////
        internal override void BaseUriChanged(AtomUri uriBase)
        {
            base.BaseUriChanged(uriBase);

            // now walk over the entries and forward...
            uriBase = new AtomUri(Utilities.CalculateUri(this.Base, uriBase, null));

            foreach (AtomEntry entry in this.Entries )
            {
                entry.BaseUriChanged(uriBase);
            }
        }
예제 #36
0
 public void op_LessThanTest()
 {
     AtomUri a = new AtomUri("A");
     AtomUri b = new AtomUri("A");
     bool expected = false; 
     bool actual;
     actual = (a < b);
     Assert.AreEqual(expected, actual);
 }
예제 #37
0
 /// <summary>Little helper that checks if a string is XML persistable</summary>
 public static bool IsPersistable(AtomUri uriString)
 {
     return(uriString == null ? false : Utilities.IsPersistable(uriString.ToString()));
 }
예제 #38
0
 public void FindTest1()
 {
     AtomCategoryCollection target = new AtomCategoryCollection(); // TODO: Initialize to an appropriate value
     AtomCategory value = new AtomCategory("test", "scheme");
     target.Add(value);
     string term = "test";
     AtomUri scheme = new AtomUri("scheme");
     AtomCategory actual;
     actual = target.Find(term, scheme);
     Assert.AreEqual(value, actual);
 }
예제 #39
0
        //////////////////////////////////////////////////////////////////////
        /// <summary>public static string CalculateUri(string base, string inheritedBase, string local)</summary> 
        /// <param name="localBase">the baseUri from xml:base </param>
        /// <param name="inheritedBase">the pushed down baseUri from an outer element</param>
        /// <param name="localUri">the Uri value</param>
        /// <returns>the absolute Uri to use... </returns>
        //////////////////////////////////////////////////////////////////////
        internal static string CalculateUri(AtomUri localBase, AtomUri inheritedBase, string localUri)
        {
            try 
            {
                Uri uriBase = null;
                Uri uriSuperBase= null;
                Uri uriComplete = null;
    
                if (inheritedBase != null)
                {
                    uriSuperBase = new Uri(inheritedBase.ToString()); 
                }
                if (localBase != null)
                {
                    if (uriSuperBase != null)
                    {
                        uriBase = new Uri(uriSuperBase, localBase.ToString());
                    }
                    else
                    {
                        uriBase = new Uri(localBase.ToString());
                    }
                }
                else
                {
                    // if no local xml:base, take the passed down one
                    uriBase = uriSuperBase;
                }
                if (localUri != null)
                {
                    if (uriBase != null)
                    {
                        uriComplete = new Uri(uriBase, localUri.ToString());
                    }
                    else
                    {
                        uriComplete = new Uri(localUri.ToString());
                    }
                }
                else 
                {
                    uriComplete = uriBase;
                }
    
                return uriComplete != null ? uriComplete.AbsoluteUri : null;
            }
            catch (System.UriFormatException)
            {
                return "Unsupported URI format"; 
            }

        }
예제 #40
0
        /// <summary>just go down the child collections</summary> 
        /// <param name="uriBase"> as currently calculated</param>
        internal override void BaseUriChanged(AtomUri uriBase) {
            base.BaseUriChanged(uriBase);

            foreach (AtomPerson person in this.Authors) {
                person.BaseUriChanged(uriBase);
            }

            // saving Contributors
            foreach (AtomPerson person in this.Contributors) {
                person.BaseUriChanged(uriBase);
            }

            // saving Categories
            foreach (AtomCategory category in this.Categories) {
                category.BaseUriChanged(uriBase);
            }

            // saving the generator
            if (this.Generator != null) {
                this.Generator.BaseUriChanged(uriBase);
            }

            // save the icon
            if (this.Icon != null) {
                this.Icon.BaseUriChanged(uriBase);
            }

            // save the logo
            if (this.Logo != null) {
                this.Logo.BaseUriChanged(uriBase);
            }

            // save the ID
            if (this.Id != null) {
                this.Id.BaseUriChanged(uriBase);
            }

            // save the Links
            foreach (AtomLink link in this.Links) {
                link.BaseUriChanged(uriBase);
            }

            if (this.Rights != null) {
                this.Rights.BaseUriChanged(uriBase);
            }

            if (this.Subtitle != null) {
                this.Subtitle.BaseUriChanged(uriBase);
            }

            if (this.Title != null) {
                this.Title.BaseUriChanged(uriBase);
            }
        }
예제 #41
0
 /// <summary>
 /// finds a category with a given term and scheme
 /// </summary>
 /// <param name="term"></param>
 /// <param name="scheme"></param>
 /// <returns>AtomCategory or NULL</returns>
 public AtomCategory Find(string term, AtomUri scheme)
 {
     foreach (AtomCategory category in List)
     {
         if (scheme == null || scheme == category.Scheme)
         {
             if (term == category.Term)
             {
                 return category;
             }
         }
     }
     return null;
 }