コード例 #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetFederationTokenResponse response)
        {
            int currentDepth = context.get_CurrentDepth();
            int num          = currentDepth + 1;

            if (context.get_IsStartOfDocument())
            {
                num += 2;
            }
            while (context.ReadAtDepth(currentDepth))
            {
                if (context.get_IsStartElement() || context.get_IsAttribute())
                {
                    if (context.TestExpression("Credentials", num))
                    {
                        CredentialsUnmarshaller instance = CredentialsUnmarshaller.Instance;
                        response.Credentials = instance.Unmarshall(context);
                    }
                    else if (context.TestExpression("FederatedUser", num))
                    {
                        FederatedUserUnmarshaller instance2 = FederatedUserUnmarshaller.Instance;
                        response.FederatedUser = instance2.Unmarshall(context);
                    }
                    else if (context.TestExpression("PackedPolicySize", num))
                    {
                        IntUnmarshaller instance3 = IntUnmarshaller.get_Instance();
                        response.PackedPolicySize = instance3.Unmarshall(context);
                    }
                }
            }
        }
コード例 #2
0
        public static FederatedUserUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new FederatedUserUnmarshaller();
            }

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

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Credentials", targetDepth))
                    {
                        getFederationTokenResult.Credentials = CredentialsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("FederatedUser", targetDepth))
                    {
                        getFederationTokenResult.FederatedUser = FederatedUserUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("PackedPolicySize", targetDepth))
                    {
                        getFederationTokenResult.PackedPolicySize = IntUnmarshaller.GetInstance().Unmarshall(context);

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



            return(getFederationTokenResult);
        }