/// <summary> /// Gets the <see cref="NRDelegate" /> as a C# string. /// </summary> /// <param name="nrDelegate">The delegate to get the code for.</param> /// <returns>A string representing the delegate.</returns> public static string Declaration(this NRDelegate nrDelegate) { string accessModifier = AddSpace(nrDelegate.AccessModifier.Declaration( )); string genericDecl = GetGenericDefinition(nrDelegate); string genericConstraint = GetGenericConstraint(nrDelegate); return(string.Format("{0}delegate {1} {2}{3}({4}){5}", accessModifier, nrDelegate.ReturnType.Declaration( ), nrDelegate.Name, genericDecl, nrDelegate.Parameters.Declaration( ), genericConstraint)); }
/// <summary> /// Visit a <see cref="NRDelegate"/>. /// </summary> /// <param name="nrDelegate">The <see cref="NRDelegate"/> to visit.</param> public void Visit(NRDelegate nrDelegate) { VisitAttributes(nrDelegate); Output(ToString(nrDelegate.AccessModifier) + "delegate " + ToString(nrDelegate.ReturnType) + " " + nrDelegate.Name + GetGenericDefinition(nrDelegate) + "("); PrintParameters(nrDelegate.Parameters); Output(")", 0); VisitTypeParameters(nrDelegate); OutputLine(""); }
/// <summary> /// Visit a <see cref="NRDelegate"/>. /// </summary> /// <param name="nrDelegate">The <see cref="NRDelegate"/> to visit.</param> public void Visit(NRDelegate nrDelegate) { OutputLine("NRDelegate"); indent++; PrintMembers(nrDelegate); nrDelegate.Parameters.ForEach(nrParameter => nrParameter.Accept(this)); nrDelegate.ReturnType.Accept(this); indent--; }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns><c>True</c> if the delegate should be reflected.</returns> public bool Reflect(NRDelegate nrDelegate) { if (Filter.Reflect(nrDelegate)) { ReflectedDelegates++; return(true); } IgnoredDelegates++; return(false); }
/// <summary> /// Visit a <see cref="NRDelegate"/>. /// </summary> /// <param name="nrDelegate">The <see cref="NRDelegate"/> to visit.</param> public void Visit(NRDelegate nrDelegate) { if (!string.IsNullOrWhiteSpace(nrDelegate.DeclaringTypeFullName) && (currentType != null && nrDelegate.DeclaringTypeFullName != currentType.FullName || currentType == null)) { // Do not output the delegate since it is nested and we are not inside the parent type. return; } VisitAttributes(nrDelegate); OutputLine(nrDelegate.Declaration() + ";"); OutputEmptyLineAfterType(); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns> /// <c>True</c> if the delegate should be reflected. /// </returns> public bool Reflect(NRDelegate nrDelegate) { return(IsUnsafePointer(nrDelegate.ReturnType.ToString()) || HasUnsafeParameters(nrDelegate.Parameters) ? false : filter.Reflect(nrDelegate)); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns> /// <c>True</c> if the delegate should be reflected. /// </returns> public bool Reflect(NRDelegate nrDelegate) { return IsUnsafePointer(nrDelegate.ReturnType) || HasUnsafeParameters(nrDelegate.Parameters) ? false : filter.Reflect(nrDelegate); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns><c>True</c> if the delegate should be reflected.</returns> public bool Reflect(NRDelegate nrDelegate) { return(Reflect(FilterElements.Delegate, nrDelegate)); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns><c>True</c> if the delegate should be reflected.</returns> public bool Reflect(NRDelegate nrDelegate) { return(true); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns><c>True</c> if the delegate should be reflected.</returns> public bool Reflect(NRDelegate nrDelegate) { return(!Filter.Reflect(nrDelegate)); }
/// <summary> /// Determines if a delegate will be reflected. /// </summary> /// <param name="nrDelegate">The delegate to test.</param> /// <returns> /// <c>True</c> if the delegate should be reflected. /// </returns> public bool Reflect(NRDelegate nrDelegate) { return(filter.Reflect(nrDelegate) && CanImportParameters(nrDelegate.Parameters) && CanImportTypeUsage(nrDelegate.ReturnType)); }