Bloom.Book.BookData.SynchronizeDataItemsFromContentsOfElement C# (CSharp) Метод

SynchronizeDataItemsFromContentsOfElement() приватный Метод

Go through the document, reading in values from fields, and then pushing variable values back into fields. Here we're calling "fields" the html supplying or receiving the data, and "variables" being key-value pairs themselves, which are, for library variables, saved in a separate file.
private SynchronizeDataItemsFromContentsOfElement ( XmlNode elementToReadFrom, string>.HashSet itemsToDelete ) : DataSet
elementToReadFrom System.Xml.XmlNode
itemsToDelete string>.HashSet
Результат DataSet
        private DataSet SynchronizeDataItemsFromContentsOfElement(XmlNode elementToReadFrom, HashSet<Tuple<string, string>> itemsToDelete)
        {
            DataSet data = GatherDataItemsFromCollectionSettings(_collectionSettings);

            // The first encountered value for data-book/data-collection wins... so the rest better be read-only to the user, or they're in for some frustration!
            // If we don't like that, we'd need to create an event to notice when field are changed.

            GatherDataItemsFromXElement(data, elementToReadFrom, itemsToDelete);

            //REVIEW: this method, SynchronizeDataItemsFromContentsOfElement(), is confusing because it  is not static and yet it
            //creates a new DataSet, ignoring its member variable _dataset. In MigrateData, we are changing things in the datadiv and
            //want to both change the values in our _dataset but also have those changes pushed throughout the DOM via the following
            //call to UpdateDomFromDataSet().

            MigrateData(data);

            //            SendDataToDebugConsole(data);
            UpdateDomFromDataSet(data, "*", _dom.RawDom, itemsToDelete);

            //REVIEW: the other methods here are, for some reason, acting on a local DataSet, "data".
            //But then this one is acting on the member variable. First Q: why is the rest of this method acting on a local variable dataset?
            UpdateTitle();
            SetUpDisplayOfTopicInBook(_dataset);
            return data;
        }