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

            return(instance);
        }
Beispiel #2
0
        public EngineDefaults Unmarshall(UnmarshallerContext context)
        {
            EngineDefaults engineDefaults = new EngineDefaults();
            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("DBParameterGroupFamily", targetDepth))
                    {
                        engineDefaults.DBParameterGroupFamily = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("Parameters/Parameter", targetDepth))
                    {
                        engineDefaults.Parameters.Add(ParameterUnmarshaller.GetInstance().Unmarshall(context));

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

            return(engineDefaults);
        }
Beispiel #3
0
        public DescribeDBParametersResult Unmarshall(UnmarshallerContext context)
        {
            DescribeDBParametersResult describeDBParametersResult = new DescribeDBParametersResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Parameters/Parameter", targetDepth))
                    {
                        describeDBParametersResult.Parameters.Add(ParameterUnmarshaller.GetInstance().Unmarshall(context));

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

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

            return(describeDBParametersResult);
        }