public static FederatedUserUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new FederatedUserUnmarshaller();
            }

            return(instance);
        }
Пример #2
0
        public GetFederationTokenResult Unmarshall(UnmarshallerContext 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);
        }