Esempio n. 1
0
        /// <summary>
        /// Returns all the instances of <see cref="ConfigurationNodeMergeData"/> contained in this environment, indexed by the path of the configuration they apply to.
        /// <seealso cref="ConfigurationNodeMergeData"/>
        /// </summary>
        /// <param name="hierarchy"></param>
        /// <param name="useFullPathNames"></param>
        /// <returns></returns>
        public Dictionary <string, ConfigurationNodeMergeData> UnfoldMergeData(IConfigurationUIHierarchy hierarchy, bool useFullPathNames)
        {
            Dictionary <string, ConfigurationNodeMergeData> result = new Dictionary <string, ConfigurationNodeMergeData>();

            foreach (Guid configurationNodeId in mergeDataDictionary.Keys)
            {
                ConfigurationNode configurationNode = hierarchy.FindNodeById(configurationNodeId);
                string            rootNodePath      = hierarchy.RootNode.Path;

                if (configurationNode != null)
                {
                    string configurationNodePath = configurationNode.Path;
                    if (!useFullPathNames)
                    {
                        configurationNodePath = SerializationUtility.CreatePathRelativeToRootNode(configurationNodePath, hierarchy);
                    }

                    result.Add(configurationNodePath, mergeDataDictionary[configurationNodeId]);
                }
            }

            return(result);
        }