Beispiel #1
0
        /// <summary>
        ///     Gets the <see cref="NRConstructor" /> as a C# string.
        /// </summary>
        /// <param name="constructor">The constructor to get the code for.</param>
        /// <returns>A string representing the constructor.</returns>
        public static string Declaration(this NRConstructor constructor)
        {
            string accessModifier = AddSpace(constructor.AccessModifier.Declaration( ));
            string modifier       = AddSpace(constructor.OperationModifier.Declaration( ));

            return(string.Format("{0}{1}{2}({3})", accessModifier, modifier, constructor.Name, constructor.Parameters.Declaration( )));
        }
Beispiel #2
0
 /// <summary>
 /// Visit a <see cref="NRConstructor"/>.
 /// </summary>
 /// <param name="nrConstructor">The <see cref="NRConstructor"/> to visit.</param>
 public void Visit(NRConstructor nrConstructor)
 {
     VisitAttributes(nrConstructor);
     Output(ToString(nrConstructor.AccessModifier) + ToString(nrConstructor.OperationModifier) + nrConstructor.Name + "(");
     PrintParameters(nrConstructor.Parameters);
     OutputLine(")", 0);
 }
 /// <summary>
 /// Visit a <see cref="NRConstructor"/>.
 /// </summary>
 /// <param name="nrConstructor">The <see cref="NRConstructor"/> to visit.</param>
 public void Visit(NRConstructor nrConstructor)
 {
     OutputLine("NRConstructor");
     indent++;
     PrintMembers(nrConstructor);
     indent--;
 }
Beispiel #4
0
        /// <summary>
        /// Visit a <see cref="NRConstructor"/>.
        /// </summary>
        /// <param name="nrConstructor">The <see cref="NRConstructor"/> to visit.</param>
        public void Visit(NRConstructor nrConstructor)
        {
            VisitAttributes(nrConstructor);

            OutputLine(nrConstructor.Declaration() + "{}");
            OutputEmptyLineAfterMember();
        }
Beispiel #5
0
 /// <summary>
 ///     Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns><c>True</c> if the method should be reflected.</returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     if (Filter.Reflect(nrConstructor))
     {
         ReflectedConstructors++;
         return(true);
     }
     IgnoredConstructors++;
     return(false);
 }
Beispiel #6
0
 /// <summary>
 /// Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns>
 /// <c>True</c> if the method should be reflected.
 /// </returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     return(HasUnsafeParameters(nrConstructor.Parameters) ? false : filter.Reflect(nrConstructor));
 }
 public NRConstructorDeclaration(NRConstructor constructor)
 {
     this.constructor = constructor;
 }
Beispiel #8
0
 /// <summary>
 /// Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns>
 /// <c>True</c> if the method should be reflected.
 /// </returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
   return HasUnsafeParameters(nrConstructor.Parameters) ? false : filter.Reflect(nrConstructor);
 }
Beispiel #9
0
 /// <summary>
 ///     Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns><c>True</c> if the method should be reflected.</returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     return(Reflect(FilterElements.Constructor, nrConstructor));
 }
Beispiel #10
0
 /// <summary>
 ///     Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns><c>False</c> if the method should not be reflected.</returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     return(true);
 }
Beispiel #11
0
 /// <summary>
 ///     Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns><c>True</c> if the method should be reflected.</returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     return(!Filter.Reflect(nrConstructor));
 }
 /// <summary>
 /// Determines if a method will be reflected.
 /// </summary>
 /// <param name="nrConstructor">The method to test.</param>
 /// <returns>
 /// <c>True</c> if the method should be reflected.
 /// </returns>
 public bool Reflect(NRConstructor nrConstructor)
 {
     return(filter.Reflect(nrConstructor) && CanImportParameters(nrConstructor.Parameters));
 }