Copy() public abstract method

public abstract Copy ( ) : CodeGroup
return CodeGroup
Beispiel #1
0
 /// <summary>Adds a child code group to the current code group.</summary>
 /// <param name="group">The code group to be added as a child. This new child code group is added to the end of the list. </param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="group" /> parameter is null. </exception>
 /// <exception cref="T:System.ArgumentException">The <paramref name="group" /> parameter is not a valid code group. </exception>
 public void AddChild(CodeGroup group)
 {
     if (group == null)
     {
         throw new ArgumentNullException("group");
     }
     this.m_children.Add(group.Copy());
 }
        /// <summary>Makes a deep copy of the code group.</summary>
        /// <returns>An equivalent copy of the code group, including its membership conditions and child code groups.</returns>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
        /// </PermissionSet>
        public override CodeGroup Copy()
        {
            FirstMatchCodeGroup firstMatchCodeGroup = this.CopyNoChildren();

            foreach (object obj in base.Children)
            {
                CodeGroup codeGroup = (CodeGroup)obj;
                firstMatchCodeGroup.AddChild(codeGroup.Copy());
            }
            return(firstMatchCodeGroup);
        }
        /// <summary>Makes a deep copy of the current code group.</summary>
        /// <returns>An equivalent copy of the current code group, including its membership conditions and child code groups.</returns>
        public override CodeGroup Copy()
        {
            FileCodeGroup fileCodeGroup = new FileCodeGroup(base.MembershipCondition, this.m_access);

            fileCodeGroup.Name        = base.Name;
            fileCodeGroup.Description = base.Description;
            foreach (object obj in base.Children)
            {
                CodeGroup codeGroup = (CodeGroup)obj;
                fileCodeGroup.AddChild(codeGroup.Copy());
            }
            return(fileCodeGroup);
        }
 public void AddChild( CodeGroup group )
 {
     if (group == null)
         throw new ArgumentNullException("group");
         
     if (m_children == null)
         ParseChildren();
     
     lock (this)
     {
         m_children.Add( group.Copy() );
     }
 }
Beispiel #5
0
 public void AddChild(CodeGroup group)
 {
     if (group == null)
     {
         throw new ArgumentNullException("group");
     }
     if (this.m_children == null)
     {
         this.ParseChildren();
     }
     lock (this)
         this.m_children.Add((object)group.Copy());
 }
 [System.Security.SecuritySafeCritical]  // auto-generated
 public void AddChild( CodeGroup group )
 {
     if (group == null)
         throw new ArgumentNullException("group");
     Contract.EndContractBlock();
         
     if (m_children == null)
         ParseChildren();
     
     lock (this)
     {
         m_children.Add( group.Copy() );
     }
 }
Beispiel #7
0
        /// <summary>Makes a deep copy of the current code group.</summary>
        /// <returns>An equivalent copy of the current code group, including its membership conditions and child code groups.</returns>
        public override CodeGroup Copy()
        {
            NetCodeGroup netCodeGroup = new NetCodeGroup(base.MembershipCondition);

            netCodeGroup.Name            = base.Name;
            netCodeGroup.Description     = base.Description;
            netCodeGroup.PolicyStatement = base.PolicyStatement;
            foreach (object obj in base.Children)
            {
                CodeGroup codeGroup = (CodeGroup)obj;
                netCodeGroup.AddChild(codeGroup.Copy());
            }
            return(netCodeGroup);
        }
 public void AddChild(CodeGroup group)
 {
     if (group == null)
     {
         throw new ArgumentNullException("group");
     }
     if (this.m_children == null)
     {
         this.ParseChildren();
     }
     lock (this)
     {
         this.m_children.Add(group.Copy());
     }
 }
        internal CodeGroup Copy(bool childs)
        {
            UnionCodeGroup unionCodeGroup = new UnionCodeGroup(base.MembershipCondition, base.PolicyStatement);

            unionCodeGroup.Name        = base.Name;
            unionCodeGroup.Description = base.Description;
            if (childs)
            {
                foreach (object obj in base.Children)
                {
                    CodeGroup codeGroup = (CodeGroup)obj;
                    unionCodeGroup.AddChild(codeGroup.Copy());
                }
            }
            return(unionCodeGroup);
        }
        [System.Security.SecuritySafeCritical]  // auto-generated
        public void AddChild(CodeGroup group)
        {
            if (group == null)
            {
                throw new ArgumentNullException("group");
            }
            Contract.EndContractBlock();

            if (m_children == null)
            {
                ParseChildren();
            }

            lock (this)
            {
                m_children.Add(group.Copy());
            }
        }
 /// <summary>Resolves matching code groups.</summary>
 /// <returns>A <see cref="T:System.Security.Policy.CodeGroup" /> that is the root of the tree of matching code groups.</returns>
 /// <param name="evidence">The evidence for the assembly. </param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="evidence" /> parameter is null. </exception>
 public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
 {
     if (evidence == null)
     {
         throw new ArgumentNullException("evidence");
     }
     if (!base.MembershipCondition.Check(evidence))
     {
         return(null);
     }
     foreach (object obj in base.Children)
     {
         CodeGroup codeGroup = (CodeGroup)obj;
         if (codeGroup.Resolve(evidence) != null)
         {
             return(codeGroup.Copy());
         }
     }
     return(this.CopyNoChildren());
 }
Beispiel #12
0
		public void AddChild (CodeGroup group)
		{
			if (null == group)
				throw new ArgumentNullException ("group");

			m_children.Add (group.Copy ());
		}