当前位置: 首页>>代码示例>>C#>>正文


C# CodeAttributeDeclarationCollection.GetEnumerator方法代码示例

本文整理汇总了C#中System.CodeDom.CodeAttributeDeclarationCollection.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# CodeAttributeDeclarationCollection.GetEnumerator方法的具体用法?C# CodeAttributeDeclarationCollection.GetEnumerator怎么用?C# CodeAttributeDeclarationCollection.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.CodeDom.CodeAttributeDeclarationCollection的用法示例。


在下文中一共展示了CodeAttributeDeclarationCollection.GetEnumerator方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OutputAttributes

 private void OutputAttributes(CodeAttributeDeclarationCollection attributes, bool inLine, string prefix, bool closingLine)
 {
     if (attributes.Count != 0)
     {
         IEnumerator enumerator = attributes.GetEnumerator();
         bool flag = true;
         this.GenerateAttributeDeclarationsStart(attributes);
         while (enumerator.MoveNext())
         {
             if (flag)
             {
                 flag = false;
             }
             else
             {
                 base.Output.Write(", ");
                 if (!inLine)
                 {
                     this.ContinueOnNewLine("");
                     base.Output.Write(" ");
                 }
             }
             if ((prefix != null) && (prefix.Length > 0))
             {
                 base.Output.Write(prefix);
             }
             CodeAttributeDeclaration current = (CodeAttributeDeclaration)enumerator.Current;
             if (current.AttributeType != null)
             {
                 base.Output.Write(this.GetTypeOutput(current.AttributeType));
             }
             base.Output.Write("(");
             bool flag2 = true;
             foreach (CodeAttributeArgument argument in current.Arguments)
             {
                 if (flag2)
                 {
                     flag2 = false;
                 }
                 else
                 {
                     base.Output.Write(", ");
                 }
                 this.OutputAttributeArgument(argument);
             }
             base.Output.Write(")");
         }
         this.GenerateAttributeDeclarationsEnd(attributes);
         base.Output.Write(" ");
         if (!inLine)
         {
             if (closingLine)
             {
                 base.Output.WriteLine();
             }
             else
             {
                 this.ContinueOnNewLine("");
             }
         }
     }
 }
开发者ID:laymain,项目名称:CodeDomUtils,代码行数:62,代码来源:VBCodeGenerator.cs

示例2: OutputAttributeDeclarations

		protected virtual void OutputAttributeDeclarations (CodeAttributeDeclarationCollection attributes)
		{
			GenerateAttributeDeclarationsStart (attributes);
			
			IEnumerator enumerator = attributes.GetEnumerator();
			if (enumerator.MoveNext()) {
				CodeAttributeDeclaration attribute = (CodeAttributeDeclaration)enumerator.Current;

				OutputAttributeDeclaration (attribute);
				
				while (enumerator.MoveNext()) {
					attribute = (CodeAttributeDeclaration)enumerator.Current;

					output.WriteLine (',');
					OutputAttributeDeclaration (attribute);
				}
			}

			GenerateAttributeDeclarationsEnd (attributes);
		}
开发者ID:carrie901,项目名称:mono,代码行数:20,代码来源:CodeGenerator.cs

示例3: OutputAttributes

		private void OutputAttributes (CodeAttributeDeclarationCollection attributes, string prefix, LineHandling lineHandling) {
			if (attributes.Count == 0) {
				return;
			}

			GenerateAttributeDeclarationsStart (attributes);

			IEnumerator enumerator = attributes.GetEnumerator ();
			if (enumerator.MoveNext ()) {
				CodeAttributeDeclaration att = (CodeAttributeDeclaration) enumerator.Current;
				if (prefix != null) {
					Output.Write (prefix);
				}
				OutputAttributeDeclaration (att);

				while (enumerator.MoveNext ()) {
					Output.Write (", ");
					if (lineHandling != LineHandling.InLine) {
						ContinueOnNewLine ("");
						Output.Write (" ");
					}
					att = (CodeAttributeDeclaration) enumerator.Current;
					if (prefix != null) {
						Output.Write (prefix);
					}
					OutputAttributeDeclaration (att);
				}
			}
			GenerateAttributeDeclarationsEnd (attributes);
			Output.Write (" ");

			switch (lineHandling) {
				case LineHandling.ContinueLine:
					ContinueOnNewLine ("");
					break;
				case LineHandling.NewLine:
					Output.WriteLine ();
					break;
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:40,代码来源:VBCodeGenerator.cs

示例4: GenerateAttributes

        private void GenerateAttributes(CodeAttributeDeclarationCollection attributes, string prefix, bool inLine) {
            if (attributes.Count == 0) return;
            IEnumerator en = attributes.GetEnumerator();
            bool paramArray =false;

            while (en.MoveNext()) { 
                // we need to convert paramArrayAttribute to params keyword to 
                // make csharp compiler happy. In addition, params keyword needs to be after 
                // other attributes.

                CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;

                if( current.Name.Equals("system.paramarrayattribute", StringComparison.OrdinalIgnoreCase)) {
                    paramArray = true;
                    continue;
                }

                GenerateAttributeDeclarationsStart(attributes);
                if (prefix != null) {
                    Output.Write(prefix);
                }

                if( current.AttributeType != null) {
                    Output.Write(GetTypeOutput(current.AttributeType));
                }
                Output.Write("(");

                bool firstArg = true;
                foreach (CodeAttributeArgument arg in current.Arguments) {
                    if (firstArg) {
                        firstArg = false;
                    }
                    else {
                        Output.Write(", ");
                    }

                    OutputAttributeArgument(arg);
                }

                Output.Write(")");
                GenerateAttributeDeclarationsEnd(attributes);
                if (inLine) {
                    Output.Write(" ");
                } 
                else {
                    Output.WriteLine();
                }
            }

            if( paramArray) {
                if (prefix != null) {
                    Output.Write(prefix);
                }
                Output.Write("params");
                
                if (inLine) {
                    Output.Write(" ");
                } 
                else {
                    Output.WriteLine();
                }
            }


        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:65,代码来源:csharpcodeprovider.cs

示例5: GenerateAttributes

        private void GenerateAttributes(CodeAttributeDeclarationCollection attributes, string prefix, bool inLine) {
            if (attributes.Count == 0) return;
            IEnumerator en = attributes.GetEnumerator();
            while (en.MoveNext()) {
                GenerateAttributeDeclarationsStart(attributes);
                if (prefix != null) {
                    Output.Write(prefix);
                }

                CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;
                Output.Write(GetBaseTypeOutput(current.Name));
                Output.Write("(");

                bool firstArg = true;
                foreach (CodeAttributeArgument arg in current.Arguments) {
                    if (firstArg) {
                        firstArg = false;
                    }
                    else {
                        Output.Write(", ");
                    }

                    OutputAttributeArgument(arg);
                }

                Output.Write(")");
                GenerateAttributeDeclarationsEnd(attributes);
                if (inLine) {
                    Output.Write(" ");
                } 
                else {
                    Output.WriteLine();
                }
            }
        }
开发者ID:ArildF,项目名称:masters,代码行数:35,代码来源:csharpcodeprovider.cs

示例6: OutputAttributeDeclarations

        /// <devdoc>
        ///    <para>
        ///       Generates code for the specified System.CodeDom.CodeAttributeBlock.
        ///    </para>
        /// </devdoc>
        protected virtual void OutputAttributeDeclarations(CodeAttributeDeclarationCollection attributes) {
            if (attributes.Count == 0) return;
            GenerateAttributeDeclarationsStart(attributes);
            bool first = true;
            IEnumerator en = attributes.GetEnumerator();
            while (en.MoveNext()) {
                if (first) {
                    first = false;
                }
                else {
                    ContinueOnNewLine(", ");
                }

                CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;
                Output.Write(current.Name);
                Output.Write("(");

                bool firstArg = true;
                foreach (CodeAttributeArgument arg in current.Arguments) {
                    if (firstArg) {
                        firstArg = false;
                    }
                    else {
                        Output.Write(", ");
                    }

                    OutputAttributeArgument(arg);
                }

                Output.Write(")");

            }
            GenerateAttributeDeclarationsEnd(attributes);
        }
开发者ID:uQr,项目名称:referencesource,代码行数:39,代码来源:CodeGenerator.cs

示例7: ValidateAttributes

        private void ValidateAttributes(CodeAttributeDeclarationCollection attributes) {
            if (attributes.Count == 0) return;
            IEnumerator en = attributes.GetEnumerator();
            while (en.MoveNext()) {
                CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;
                ValidateTypeName(current,"Name",current.Name);
                ValidateTypeReference(current.AttributeType);

                foreach (CodeAttributeArgument arg in current.Arguments) {
                  ValidateAttributeArgument(arg);
                }
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:CodeValidator.cs

示例8: GenerateAssemblyAttributes

 private void GenerateAssemblyAttributes(CodeAttributeDeclarationCollection attributes) {
   if (attributes.Count == 0) return;
   IEnumerator en = attributes.GetEnumerator();
   while (en.MoveNext()) {
     Output.Write("[");
     Output.Write("assembly: ");
     CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;
     Output.Write(GetBaseTypeOutput(current.Name));
     Output.Write("(");
     bool firstArg = true;
     foreach (CodeAttributeArgument arg in current.Arguments) {
       if (firstArg) {
         firstArg = false;
       } else {
         Output.Write(", ");
       }
       OutputAttributeArgument(arg);
     }
     Output.Write(")");
     Output.Write("]");
     Output.WriteLine();
   }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:23,代码来源:jscodegenerator.cs

示例9: GenerateAttributes

 private void GenerateAttributes(CodeAttributeDeclarationCollection attributes, string prefix, bool inLine)
 {
     if (attributes.Count != 0)
     {
         IEnumerator enumerator1 = attributes.GetEnumerator();
         bool flag1 = false;
         while (enumerator1.MoveNext())
         {
             CodeAttributeDeclaration declaration1 = (CodeAttributeDeclaration) enumerator1.Current;
             if (declaration1.Name.Equals("system.paramarrayattribute", StringComparison.OrdinalIgnoreCase))
             {
                 flag1 = true;
             }
             else
             {
                 this.GenerateAttributeDeclarationsStart(attributes);
                 if (prefix != null)
                 {
                     this.Output.Write(prefix);
                 }
                 if (declaration1.AttributeType != null)
                 {
                     this.Output.Write(this.GetTypeOutput(declaration1.AttributeType));
                 }
                 this.Output.Write("(");
                 bool flag2 = true;
                 foreach (CodeAttributeArgument argument1 in declaration1.Arguments)
                 {
                     if (flag2)
                     {
                         flag2 = false;
                     }
                     else
                     {
                         this.Output.Write(", ");
                     }
                     this.OutputAttributeArgument(argument1);
                 }
                 this.Output.Write(")");
                 this.GenerateAttributeDeclarationsEnd(attributes);
                 if (inLine)
                 {
                     this.Output.Write(" ");
                     continue;
                 }
                 this.Output.WriteLine();
             }
         }
         if (flag1)
         {
             if (prefix != null)
             {
                 this.Output.Write(prefix);
             }
             this.Output.Write("params");
             if (inLine)
             {
                 this.Output.Write(" ");
             }
             else
             {
                 this.Output.WriteLine();
             }
         }
     }
 }
开发者ID:sillsdev,项目名称:FwSupportTools,代码行数:66,代码来源:CSharpCodeGenerator.cs

示例10: OutputAttributeDeclarations

      // Generates code for the specified System.CodeDom.CodeAttributeBlock.
      protected override void OutputAttributeDeclarations(CodeAttributeDeclarationCollection attributes) {
        if (attributes.Count == 0) return;
        GenerateAttributeDeclarationsStart(attributes);
        IEnumerator en = attributes.GetEnumerator();
        while (en.MoveNext()) {
          CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;
          Output.Write(GetBaseTypeOutput(current.Name));
          Output.Write("(");

          bool firstArg = true;
          foreach (CodeAttributeArgument arg in current.Arguments) {
            if (firstArg) {
              firstArg = false;
            } else {
              Output.Write(", ");
            }
            OutputAttributeArgument(arg);
          }
          Output.Write(") ");
        }
        GenerateAttributeDeclarationsEnd(attributes);
      }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:23,代码来源:jscodegenerator.cs

示例11: OutputAttributes

        private void OutputAttributes(CodeAttributeDeclarationCollection attributes, bool inLine, string prefix, bool closingLine) {
            if (attributes.Count == 0) return;
            IEnumerator en = attributes.GetEnumerator();
            bool firstAttr = true;
            GenerateAttributeDeclarationsStart(attributes);
            while (en.MoveNext()) {

                if (firstAttr) {
                    firstAttr = false;
                }
                else {
                    Output.Write(", ");
                    if (!inLine) {
                        ContinueOnNewLine("");
                        Output.Write(" ");
                    }
                }

                if (prefix != null && prefix.Length > 0) {
                    Output.Write(prefix);
                }

                CodeAttributeDeclaration current = (CodeAttributeDeclaration)en.Current;

                if( current.AttributeType != null) {                
                    Output.Write(GetTypeOutput(current.AttributeType));
                }
                Output.Write("(");

                bool firstArg = true;
                foreach (CodeAttributeArgument arg in current.Arguments) {
                    if (firstArg) {
                        firstArg = false;
                    }
                    else {
                        Output.Write(", ");
                    }

                    OutputAttributeArgument(arg);
                }

                Output.Write(")");

            }
            GenerateAttributeDeclarationsEnd(attributes);
            Output.Write(" ");            
            if (!inLine) {
                if (closingLine) {
                    Output.WriteLine();
                }
                else {
                    ContinueOnNewLine("");
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:55,代码来源:VBCodeProvider.cs

示例12: GenerateAttributes

 private void GenerateAttributes(CodeAttributeDeclarationCollection attributes, string prefix, bool inLine)
 {
     if (attributes.Count != 0)
     {
         IEnumerator enumerator = attributes.GetEnumerator();
         while (enumerator.MoveNext())
         {
             this.GenerateAttributeDeclarationsStart(attributes);
             if (prefix != null)
             {
                 if (string.Compare(prefix, "assembly: ", false, CultureInfo.InvariantCulture) == 0)
                 {
                     base.Output.Write("@assembly ");
                 }
                 else if (string.Compare(prefix, "return: ", false, CultureInfo.InvariantCulture) == 0)
                 {
                     base.Output.Write("@attribute.return ");
                 }
                 else
                 {
                     base.Output.Write("@attribute ");
                 }
             }
             else
             {
                 base.Output.Write("@attribute ");
             }
             CodeAttributeDeclaration current = (CodeAttributeDeclaration) enumerator.Current;
             string baseTypeOutput = this.GetBaseTypeOutput(current.Name);
             base.Output.Write(baseTypeOutput);
             base.Output.Write("(");
             bool flag = true;
             foreach (CodeAttributeArgument argument in current.Arguments)
             {
                 if (flag)
                 {
                     flag = false;
                 }
                 else
                 {
                     base.Output.Write(", ");
                 }
                 this.fIsAttributeArg = true;
                 this.OutputAttributeArgument(argument);
                 this.fIsAttributeArg = false;
             }
             base.Output.Write(")");
             this.GenerateAttributeDeclarationsEnd(attributes);
             if (inLine)
             {
                 base.Output.Write(" ");
             }
             else
             {
                 base.Output.WriteLine();
             }
         }
     }
 }
开发者ID:ikvm,项目名称:webmatrix,代码行数:59,代码来源:JSharpCodeGenerator.cs

示例13: GenerateAttributes

        private void GenerateAttributes(CodeAttributeDeclarationCollection attributes, string prefix, bool inLine)
        {
            if (attributes.Count != 0)
            {
                IEnumerator enumerator = attributes.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    CodeAttributeDeclaration current = (CodeAttributeDeclaration)enumerator.Current;
                    this.GenerateAttributeDeclarationsStart(attributes);
                    if (prefix != null)
                    {

                        base.Output.Write(prefix + ": ");
                    }
                    else
                    {
                        base.Output.Write("@@");
                    }
                    if (current.AttributeType != null)
                    {
                        base.Output.Write(this.GetTypeOutput(current.AttributeType));
                    }
                    base.Output.Write("(");
                    bool flag = true;
                    foreach (CodeAttributeArgument argument in current.Arguments)
                    {
                        if (flag)
                        {
                            flag = false;
                        }
                        else
                        {
                            base.Output.Write(", ");
                        }
                        this.OutputAttributeArgument(argument);
                    }
                    base.Output.Write(")");
                    this.GenerateAttributeDeclarationsEnd(attributes);
                    if (inLine)
                    {
                        base.Output.Write(" ");
                    }
                    else
                    {
                        base.Output.WriteLine();
                    }
                }
            }
        }
开发者ID:X-Sharp,项目名称:XSharpPublic,代码行数:49,代码来源:XSharpCodeGenerator.cs

示例14: OutputAttributeDeclarations

 protected virtual void OutputAttributeDeclarations(CodeAttributeDeclarationCollection attributes)
 {
     if (attributes.Count != 0)
     {
         this.GenerateAttributeDeclarationsStart(attributes);
         bool flag = true;
         IEnumerator enumerator = attributes.GetEnumerator();
         while (enumerator.MoveNext())
         {
             if (flag)
             {
                 flag = false;
             }
             else
             {
                 this.ContinueOnNewLine(", ");
             }
             CodeAttributeDeclaration current = (CodeAttributeDeclaration) enumerator.Current;
             this.Output.Write(current.Name);
             this.Output.Write("(");
             bool flag2 = true;
             foreach (CodeAttributeArgument argument in current.Arguments)
             {
                 if (flag2)
                 {
                     flag2 = false;
                 }
                 else
                 {
                     this.Output.Write(", ");
                 }
                 this.OutputAttributeArgument(argument);
             }
             this.Output.Write(")");
         }
         this.GenerateAttributeDeclarationsEnd(attributes);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:38,代码来源:CodeGenerator.cs


注:本文中的System.CodeDom.CodeAttributeDeclarationCollection.GetEnumerator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。