internal static PSWorkflowExecutionOption LoadConfig(string privateData, PSWorkflowConfigurationProvider configuration)
        {
            PSWorkflowExecutionOption pSWorkflowExecutionOption = new PSWorkflowExecutionOption();

            if (!string.IsNullOrEmpty(privateData))
            {
                XmlReaderSettings xmlReaderSetting = new XmlReaderSettings();
                xmlReaderSetting.CheckCharacters = false;
                xmlReaderSetting.IgnoreComments  = true;
                xmlReaderSetting.IgnoreProcessingInstructions = true;
                xmlReaderSetting.MaxCharactersInDocument      = (long)0x2710;
                xmlReaderSetting.XmlResolver      = null;
                xmlReaderSetting.ConformanceLevel = ConformanceLevel.Fragment;
                XmlReaderSettings xmlReaderSetting1 = xmlReaderSetting;
                XmlReader         xmlReader         = XmlReader.Create(new StringReader(privateData), xmlReaderSetting1);
                using (xmlReader)
                {
                    if (xmlReader.ReadToFollowing("PrivateData"))
                    {
                        HashSet <string> strs       = new HashSet <string>();
                        bool             descendant = xmlReader.ReadToDescendant("Param");
                        while (descendant)
                        {
                            if (xmlReader.MoveToAttribute("Name"))
                            {
                                string value = xmlReader.Value;
                                if (xmlReader.MoveToAttribute("Value"))
                                {
                                    if (!strs.Contains(value.ToLower(CultureInfo.InvariantCulture)))
                                    {
                                        string str = xmlReader.Value;
                                        PSWorkflowConfigurationProvider.Update(value, str, pSWorkflowExecutionOption, configuration);
                                        strs.Add(value.ToLower(CultureInfo.InvariantCulture));
                                        descendant = xmlReader.ReadToFollowing("Param");
                                    }
                                    else
                                    {
                                        throw new PSArgumentException(Resources.ParamSpecifiedMoreThanOnce, value);
                                    }
                                }
                                else
                                {
                                    throw new PSArgumentException(Resources.ValueNotSpecifiedForParam);
                                }
                            }
                            else
                            {
                                throw new PSArgumentException(Resources.NameNotSpecifiedForParam);
                            }
                        }
                    }
                }
                return(pSWorkflowExecutionOption);
            }
            else
            {
                return(pSWorkflowExecutionOption);
            }
        }