Пример #1
0
        public static SubjectType Load(XElement SubjectElement)
        {
            var st = new SubjectType();

            foreach (var e in SubjectElement.Elements())
            {
                switch (e.Name.LocalName)
                {
                //case "BaseID": st.BaseID = BaseIDType.Load(e); break;
                case "NameID": st.NameID = NameIDType.Load(e); break;

                //case "EncryptedID": st.EncryptedID = EncryptedIDType.Load(e); break;
                //case "SubjectConfirmation": st.SubjectConfirmations.Add(new SubjectConfirmationType(e)); break;
                case "SubjectConfirmation": st.SubjectConfirmations.Add(SubjectConfirmationType.Load(e)); break;
                }
            }

            if (st.NameID == null && st.SubjectConfirmations.Count == 0)
            {
                throw new Exception("SubjectType error");
            }

            return(st);
        }