Guest User

Untitled

a guest
May 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.22 KB | None | 0 0
  1. public void ReadXml(XmlReader reader)
  2. {
  3.     reader.MoveToContent();
  4.            
  5.     if (reader.ReadToDescendant("TaggingProfileEntry"))
  6.     {
  7.         while (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName.Equals("TaggingProfileEntry"))
  8.         {
  9.             string termSetName = reader.GetAttribute("TermSetName");
  10.             string taxonomyFieldValueCollectionString = reader.GetAttribute("ValueCollectionString");
  11.  
  12.             if (!string.IsNullOrEmpty(termSetName) && !string.IsNullOrEmpty(taxonomyFieldValueCollectionString))
  13.             {
  14.                 TaxonomyFieldValueCollection taxonomyFieldValueCollection = new TaxonomyFieldValueCollection(string.Empty);
  15.                        
  16.                 taxonomyFieldValueCollection.PopulateFromLabelGuidPairs(taxonomyFieldValueCollectionString);
  17.  
  18.                 // Populate values with Wss Id's
  19.                 foreach (TaxonomyFieldValue taxonomyFieldValue in taxonomyFieldValueCollection)
  20.                 {
  21.                     taxonomyFieldValue.PopulateWssId(TERM_STORE_GROUP_NAME, termSetName);
  22.                 }
  23.  
  24.                 this[termSetName] = taxonomyFieldValueCollection;
  25.             }
  26.  
  27.             reader.Read();
  28.         }
  29.     }
  30. }
Add Comment
Please, Sign In to add comment