Example #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( )));
        }
Example #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--;
 }
Example #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();
        }
Example #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);
 }
Example #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;
 }
Example #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);
 }
Example #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));
 }
Example #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);
 }
Example #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));
 }
Example #12
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) && CanImportParameters(nrConstructor.Parameters));
 }