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

            return(instance);
        }
        public IndexField Unmarshall(XmlUnmarshallerContext context)
        {
            IndexField indexField    = new IndexField();
            int        originalDepth = context.CurrentDepth;
            int        targetDepth   = originalDepth + 1;

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

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

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

                        continue;
                    }
                    if (context.TestExpression("IntOptions", targetDepth))
                    {
                        indexField.IntOptions = IntOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DoubleOptions", targetDepth))
                    {
                        indexField.DoubleOptions = DoubleOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("LiteralOptions", targetDepth))
                    {
                        indexField.LiteralOptions = LiteralOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TextOptions", targetDepth))
                    {
                        indexField.TextOptions = TextOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DateOptions", targetDepth))
                    {
                        indexField.DateOptions = DateOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("LatLonOptions", targetDepth))
                    {
                        indexField.LatLonOptions = LatLonOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("IntArrayOptions", targetDepth))
                    {
                        indexField.IntArrayOptions = IntArrayOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DoubleArrayOptions", targetDepth))
                    {
                        indexField.DoubleArrayOptions = DoubleArrayOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("LiteralArrayOptions", targetDepth))
                    {
                        indexField.LiteralArrayOptions = LiteralArrayOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TextArrayOptions", targetDepth))
                    {
                        indexField.TextArrayOptions = TextArrayOptionsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DateArrayOptions", targetDepth))
                    {
                        indexField.DateArrayOptions = DateArrayOptionsUnmarshaller.GetInstance().Unmarshall(context);

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



            return(indexField);
        }