Пример #1
0
		private void WriteEnum(EnumType _enum)
		{
			// Writing type declaration
			WriteLine(_enum.GetDeclaration() + " {");
			AddBlankLine();
			IndentLevel++;

			int valuesRemained = _enum.ValueCount;
			foreach (EnumValue value in _enum.Values)
			{
				if (--valuesRemained > 0)
					WriteLine(value.GetDeclaration() + ",");
				else
					WriteLine(value.GetDeclaration());
			}

			// Writing closing bracket of the type block
			IndentLevel--;
			WriteLine("}");
		}
Пример #2
0
		public void ShowDialog(EnumType parent)
		{
			if (parent != null) {
				this.parent = parent;
				this.Text = string.Format(Strings.ItemsOfType, parent.Name);
				FillList();

				base.ShowDialog();
			}
		}
Пример #3
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="enumType"/> is null.
		/// </exception>
		internal EnumShape(EnumType _enum) : base(_enum)
		{
			this._enum = _enum;
			UpdateMinSize();
		}
Пример #4
0
 /// <summary>
 /// Adds the given enum values to the given type.
 /// </summary>
 /// <param name="type">The enum to add the enum values to.</param>
 /// <param name="values">A list of enum values to add.</param>
 private void AddEnumValues(EnumType type, IEnumerable<NREnumValue> values)
 {
   foreach (NREnumValue nrEnumValue in values)
   {
     type.AddValue(nrEnumValue.Declaration());
   }
 }