Esempio n. 1
0
        private static void LoadOptionList(
            mojoProfilePropertyDefinition profilePropertyDefinition,
            XmlNode propertyNode)
        {
            foreach (XmlNode optionListNode in propertyNode.ChildNodes)
            {
                if (optionListNode.Name == "OptionList")
                {
                    foreach (XmlNode optionNode in optionListNode.ChildNodes)
                    {
                        if (optionNode.Name == "Option")
                        {
                            mojoProfilePropertyOption option = new mojoProfilePropertyOption();
                            if (optionNode.Attributes["TextResourceKey"] != null)
                            {
                                option.TextResourceKey = optionNode.Attributes["TextResourceKey"].Value;
                            }

                            if (optionNode.Attributes["value"] != null)
                            {
                                option.Value = optionNode.Attributes["value"].Value;
                            }

                            profilePropertyDefinition.OptionList.Add(option);
                        }
                    }

                    // should only be one OptionListNode
                    break;
                }
            }
        }
        private static void LoadOptionList(
            mojoProfilePropertyDefinition profilePropertyDefinition, 
            XmlNode propertyNode)
        {
            foreach (XmlNode optionListNode in propertyNode.ChildNodes)
            {
                if (optionListNode.Name == "OptionList")
                {

                    foreach (XmlNode optionNode in optionListNode.ChildNodes)
                    {
                        if (optionNode.Name == "Option")
                        {
                            mojoProfilePropertyOption option = new mojoProfilePropertyOption();
                            if (optionNode.Attributes["TextResourceKey"] != null)
                            {
                                option.TextResourceKey = optionNode.Attributes["TextResourceKey"].Value;
                            }

                            if (optionNode.Attributes["value"] != null)
                            {
                                option.Value = optionNode.Attributes["value"].Value;
                            }

                            profilePropertyDefinition.OptionList.Add(option);

                        }
                    }

                    // should only be one OptionListNode
                    break;

                }

            }
        }