Пример #1
0
        public void FromXml(SecurityElement elem)
        {
            CodeAccessPermission.ValidateElement(elem, this);

            if (elem.InternalChildren != null && elem.InternalChildren.Count != 0)
            {
                int numChildren = elem.InternalChildren.Count;
                int count       = 0;

                m_array = new IDRole[numChildren];

                IEnumerator enumerator = elem.Children.GetEnumerator();

                while (enumerator.MoveNext())
                {
                    IDRole idrole = new IDRole();

                    idrole.FromXml((SecurityElement)enumerator.Current);

                    m_array[count++] = idrole;
                }
            }
            else
            {
                m_array = new IDRole[0];
            }
        }
Пример #2
0
 /// <summary>从 XML 编码重新构造具有指定状态的权限。</summary>
 /// <param name="elem">用于重新构造权限的 XML 编码。</param>
 /// <exception cref="T:System.ArgumentNullException">
 /// <paramref name="elem" /> 参数为 null。</exception>
 /// <exception cref="T:System.ArgumentException">
 /// <paramref name="elem" /> 参数不是有效的权限元素。- 或 -<paramref name="elem" /> 参数的版本号无效。</exception>
 public void FromXml(SecurityElement elem)
 {
     CodeAccessPermission.ValidateElement(elem, (IPermission)this);
     if (elem.InternalChildren != null && elem.InternalChildren.Count != 0)
     {
         int count = elem.InternalChildren.Count;
         int num   = 0;
         this.m_array = new IDRole[count];
         foreach (SecurityElement child in elem.Children)
         {
             IDRole idRole = new IDRole();
             idRole.FromXml(child);
             this.m_array[num++] = idRole;
         }
     }
     else
     {
         this.m_array = new IDRole[0];
     }
 }
Пример #3
0
 public void FromXml(SecurityElement elem)
 {
     CodeAccessPermission.ValidateElement(elem, this);
     if ((elem.InternalChildren != null) && (elem.InternalChildren.Count != 0))
     {
         int count = elem.InternalChildren.Count;
         int num2  = 0;
         this.m_array = new IDRole[count];
         IEnumerator enumerator = elem.Children.GetEnumerator();
         while (enumerator.MoveNext())
         {
             IDRole role = new IDRole();
             role.FromXml((SecurityElement)enumerator.Current);
             this.m_array[num2++] = role;
         }
     }
     else
     {
         this.m_array = new IDRole[0];
     }
 }
        public void FromXml(SecurityElement elem)
        {
            CodeAccessPermission.ValidateElement( elem, this );

            if (elem.InternalChildren != null && elem.InternalChildren.Count != 0)
            { 
                int numChildren = elem.InternalChildren.Count;
                int count = 0;
                
                m_array = new IDRole[numChildren];
            
                IEnumerator enumerator = elem.Children.GetEnumerator();
            
                while (enumerator.MoveNext())  
                {
                    IDRole idrole = new IDRole();
                    
                    idrole.FromXml( (SecurityElement)enumerator.Current );
                    
                    m_array[count++] = idrole;
                }
            }
            else
                m_array = new IDRole[0];
        }