Ejemplo n.º 1
0
 public void AddEnumField(FieldItem item)
 {
     FieldInfo member = (FieldInfo) item.Member;
     this._writer.Write("        ");
     if (item.IsObsolete)
     {
         this._writer.WriteBeginGroup();
         this._writer.WriteForeColorAttribute(this._obsoleteColorIndex);
         this._ignoreColor = true;
     }
     this._writer.Write(member.Name);
     if (item.IsObsolete)
     {
         this._writer.WriteEndGroup();
         this._ignoreColor = false;
     }
     this._writer.WriteLine(",");
 }
Ejemplo n.º 2
0
 public void AddField(FieldItem item)
 {
     FieldInfo member = (FieldInfo) item.Member;
     this._writer.Write("        ");
     if (item.IsObsolete)
     {
         this._writer.WriteBeginGroup();
         this._writer.WriteForeColorAttribute(this._obsoleteColorIndex);
         this._ignoreColor = true;
     }
     else
     {
         this._writer.WriteBeginGroup();
         this._writer.WriteForeColorAttribute(this._keywordColorIndex);
     }
     if (member.IsFamilyAndAssembly || member.IsFamilyOrAssembly)
     {
         this._writer.Write("protected internal ");
     }
     else if (member.IsFamily)
     {
         this._writer.Write("protected ");
     }
     else if (member.IsAssembly)
     {
         this._writer.Write("internal ");
     }
     else if (member.IsPrivate)
     {
         this._writer.Write("private ");
     }
     else
     {
         this._writer.Write("public ");
     }
     if (member.IsLiteral)
     {
         this._writer.Write("const ");
     }
     else if (member.IsStatic)
     {
         this._writer.Write("static ");
     }
     if (member.IsInitOnly)
     {
         this._writer.Write("readonly ");
     }
     if (!item.IsObsolete)
     {
         this._writer.WriteEndGroup();
     }
     this.GenerateTypeReference(member.FieldType, false, false);
     this._writer.Write(" ");
     this._writer.Write(member.Name);
     this._writer.WriteLine(";");
     if (item.IsObsolete)
     {
         this._writer.WriteEndGroup();
         this._ignoreColor = false;
     }
 }