Пример #1
0
        public IIntermediateType Add(string name, TypeKind kind)
        {
            IIntermediateType rResult = null;

            switch (kind)
            {
            case TypeKind.Class:
            {
                var result = new IntermediateClassType(name, this.Parent);
                rResult = result;
                this.Parent.Classes.Add(result);
            }
            break;

            case TypeKind.Delegate:
            {
                var result = new IntermediateDelegateType(name, this.Parent);
                rResult = result;
                this.Parent.Delegates.Add(result);
            }
            break;

            case TypeKind.Enumeration:
            {
                var result = new IntermediateEnumType(name, this.Parent);
                rResult = result;
                this.Parent.Enums.Add(result);
            }
            break;

            case TypeKind.Interface:
            {
                var result = new IntermediateInterfaceType(name, this.Parent);
                rResult = result;
                this.Parent.Interfaces.Add(result);
            }
            break;

            case TypeKind.Struct:
            {
                var result = new IntermediateStructType(name, this.Parent);
                rResult = result;
                this.Parent.Structs.Add(result);
            }
            break;

            case TypeKind.Other:
            case TypeKind.Ambiguity:
                break;

            default:
                break;
            }
            if (rResult == null)
            {
                throw new NotSupportedException();
            }
            return(rResult);
        }
 internal FieldMember(string name, IntermediateEnumType parent)
     : base(parent)
 {
     base.AssignName(name);
 }
 /// <summary>
 /// Creates a new <see cref="FieldMemberDictionary"/>
 /// with the <paramref name="master"/> and <paramref name="parent"/> provided.
 /// </summary>
 /// <param name="master">The <see cref="IntermediateFullMemberDictionary"/> which groups the
 /// elements of the <see cref="FieldMemberDictionary"/>
 /// with the <paramref name="parent"/>s other members.</param>
 /// <param name="parent">The <see cref="IntermediateEnumType"/> which contains the
 /// <see cref="FieldMemberDictionary"/></param>
 /// <exception cref="System.ArgumentNullException">thrown when <paramref name="master"/> is null; or
 /// when <paramref name="parent"/> is null.</exception>
 public FieldMemberDictionary(IntermediateFullMemberDictionary master, IntermediateEnumType parent)
     : base(master, parent)
 {
 }