Inheritance: Member
Ejemplo n.º 1
0
		private void WriteField(Field field)
		{
			WriteLine(field.GetDeclaration());
		}
Ejemplo n.º 2
0
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="field"/> contains invalid modifier combinations.
		/// </exception>
		protected override void ValidateField(Field field)
		{
			if (field.IsConstant) {
				if (field.IsStatic) {
					throw new BadSyntaxException(string.Format(
						Strings.ErrorInvalidModifierCombination, "static", "const"));
				}
				if (field.IsReadonly) {
					throw new BadSyntaxException(string.Format(
						Strings.ErrorInvalidModifierCombination, "readonly", "const"));
				}
				if (field.IsVolatile) {
					throw new BadSyntaxException(string.Format(
						Strings.ErrorInvalidModifierCombination, "volatile", "const"));
				}
			}
			if (field.IsReadonly && field.IsVolatile) {
				throw new BadSyntaxException(string.Format(
					Strings.ErrorInvalidModifierCombination, "volatile", "readonly"));
			}
		}
Ejemplo n.º 3
0
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="field"/> contains invalid modifier combinations.
		/// </exception>
		protected internal abstract void ValidateField(Field field);
Ejemplo n.º 4
0
		protected void AddField(Field field)
		{
			if (field != null && !FieldList.Contains(field))
			{
				fields.Add(field);
				field.Modified += delegate { Changed(); };
				Changed();
			}
		}
Ejemplo n.º 5
0
		private void AddNewField(Field field)
		{
			ListViewItem item = AddFieldToList(field);
			AddNewItem(item);
			OnContentsChanged(EventArgs.Empty);
		}
Ejemplo n.º 6
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="field"/> is null.
		/// </exception>
		private ListViewItem AddFieldToList(Field field)
		{
			if (field == null)
				throw new ArgumentNullException("field");

			ListViewItem item = lstMembers.Items.Insert(attributeCount, "");

			item.Tag = field;
			item.ImageIndex = Icons.GetImageIndex(field);
			item.SubItems.Add(field.Name);
			item.SubItems.Add(field.Type);
			item.SubItems.Add(parent.Language.GetAccessString(field.AccessModifier));
			item.SubItems.Add(parent.Language.GetFieldModifierString(field.Modifier));
			item.SubItems.Add("");
			attributeCount++;

			return item;
		}