Example #1
0
        public static OptionUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new OptionUnmarshaller();
            }

            return(instance);
        }
Example #2
0
        public OptionGroup Unmarshall(XmlUnmarshallerContext context)
        {
            OptionGroup optionGroup   = new OptionGroup();
            int         originalDepth = context.CurrentDepth;
            int         targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            if (context.IsStartOfDocument)
            {
                targetDepth++;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("OptionGroupName", targetDepth))
                    {
                        optionGroup.OptionGroupName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("OptionGroupDescription", targetDepth))
                    {
                        optionGroup.OptionGroupDescription = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("EngineName", targetDepth))
                    {
                        optionGroup.EngineName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("MajorEngineVersion", targetDepth))
                    {
                        optionGroup.MajorEngineVersion = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Options/Option", targetDepth))
                    {
                        optionGroup.Options.Add(OptionUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("AllowsVpcAndNonVpcInstanceMemberships", targetDepth))
                    {
                        optionGroup.AllowsVpcAndNonVpcInstanceMemberships = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("VpcId", targetDepth))
                    {
                        optionGroup.VpcId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(optionGroup);
                }
            }



            return(optionGroup);
        }