示例#1
0
        public static SignerUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new SignerUnmarshaller();
            }

            return(instance);
        }
示例#2
0
        public ActiveTrustedSigners Unmarshall(XmlUnmarshallerContext context)
        {
            ActiveTrustedSigners activeTrustedSigners = new ActiveTrustedSigners();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Enabled", targetDepth))
                    {
                        activeTrustedSigners.Enabled = BoolUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("Items/Signer", targetDepth))
                    {
                        activeTrustedSigners.Items.Add(SignerUnmarshaller.GetInstance().Unmarshall(context));

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



            return(activeTrustedSigners);
        }