コード例 #1
0
        public static EnvironmentResourcesDescriptionUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new EnvironmentResourcesDescriptionUnmarshaller();
            }

            return(instance);
        }
コード例 #2
0
        public UpdateEnvironmentResult Unmarshall(XmlUnmarshallerContext context)
        {
            UpdateEnvironmentResult updateEnvironmentResult = new UpdateEnvironmentResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

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

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

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("DateCreated", targetDepth))
                    {
                        updateEnvironmentResult.DateCreated = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DateUpdated", targetDepth))
                    {
                        updateEnvironmentResult.DateUpdated = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("Resources", targetDepth))
                    {
                        updateEnvironmentResult.Resources = EnvironmentResourcesDescriptionUnmarshaller.GetInstance().Unmarshall(context);

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



            return(updateEnvironmentResult);
        }