Beispiel #1
0
 public void CloneCustomAttributes(CodeAttributeDeclarationCollection source, CodeAttributeDeclarationCollection dest)
 {
     dest.Clear();
     foreach (CodeAttributeDeclaration decl in source)
     {
         dest.Add(CloneCustomAttribute(decl));
     }
 }
        /// <summary>
        /// Visits a <see cref="CodeAttributeDeclarationCollection"/>.
        /// </summary>
        /// <param name="codeAttributeDeclarationCollection">The <see cref="CodeAttributeDeclarationCollection"/> to visit.</param>
        protected override void VisitCodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection codeAttributeDeclarationCollection)
        {
            CodeAttributeDeclaration[] sortedAttributes = codeAttributeDeclarationCollection.Cast <CodeAttributeDeclaration>().OrderBy(a => GetAttributeId(a)).ToArray();
            codeAttributeDeclarationCollection.Clear();
            codeAttributeDeclarationCollection.AddRange(sortedAttributes);

            base.VisitCodeAttributeDeclarationCollection(codeAttributeDeclarationCollection);
        }