Пример #1
0
        /// <summary>
        /// Prints the members of the supplied <see cref="NRCompositeType"/>.
        /// </summary>
        /// <param name="nrCompositeType">The members of this <see cref="NRCompositeType"/> are printed.</param>
        private void PrintMembers(NRCompositeType nrCompositeType)
        {
            PrintMembers((NRGenericType)nrCompositeType);

            nrCompositeType.Events.ForEach(nrEvent => nrEvent.Accept(this));
            OutputLine("ImplementedInterfaces:");
            indent++;
            foreach (NRTypeUsage nrTypeUsage in nrCompositeType.ImplementedInterfaces)
            {
                nrTypeUsage.Accept(this);
            }
            indent--;
            nrCompositeType.Methods.ForEach(nrMethod => nrMethod.Accept(this));
            nrCompositeType.Properties.ForEach(nrProperty => nrProperty.Accept(this));
        }
Пример #2
0
        /// <summary>
        ///     Gets all implemented interfaces of the given <see cref="NRCompositeType" />.
        /// </summary>
        /// <param name="nrCompositeType">An <see cref="NRCompositeType" /> to take the interfaces from.</param>
        private static string GetImplementedInterfaces(NRCompositeType nrCompositeType)
        {
            if (nrCompositeType.ImplementedInterfaces.Count == 0)
            {
                return("");
            }
            StringBuilder result = new StringBuilder(" : ");

            foreach (NRTypeUsage implementedInterface in nrCompositeType.ImplementedInterfaces)
            {
                result.Append(implementedInterface.Declaration( ) + ", ");
            }
            result.Length -= 2;

            return(result.ToString( ));
        }
Пример #3
0
        /// <summary>
        /// Prints all implemented interfaces of the given <see cref="NRCompositeType"/>.
        /// </summary>
        /// <param name="nrCompositeType">An <see cref="NRCompositeType"/> to take the interfaces from.</param>
        private void PrintImplementedInterfaces(NRCompositeType nrCompositeType)
        {
            if (nrCompositeType.ImplementedInterfaces.Count == 0)
            {
                return;
            }
            Output(" : ");
            StringBuilder result = new StringBuilder();

            foreach (NRTypeUsage implementedInterface in nrCompositeType.ImplementedInterfaces)
            {
                result.Append(implementedInterface.Name + ", ");
            }
            result.Length -= 2;
            Output(result.ToString());
        }
Пример #4
0
 /// <summary>
 ///     Initializes a new instance of <see cref="NRGeneralization" />.
 /// </summary>
 /// <param name="baseType">The base type of the generalization.</param>
 /// <param name="derivedType">The derived type of the generalization.</param>
 public NRGeneralization(NRCompositeType baseType, NRCompositeType derivedType)
 {
     BaseType    = baseType;
     DerivedType = derivedType;
 }