Reflection of the my dll (that function hasn't been
documented yet) of the following function
Public Function System_IsUserAuthorizedForApp(ByVal
SecurityObjectName As String, Optional ByVal
ServerName As String = "", Optional ByVal
AllowSecurityCache_Read As Boolean = False, Optional
ByVal AllowSecurityCache_Write As Boolean = False) As
Boolean
has leaded to following output in the created
documentation:
[Visual Basic]
Public Function System_IsUserAuthorizedForApp( _
ByVal SecurityObjectName As String, _
Optional ByVal ServerName As String = , _
Optional ByVal AllowSecurityCache_Read As Boolean =
False, _
Optional ByVal AllowSecurityCache_Write As Boolean =
False _
) As Boolean
[C#]
public bool System_IsUserAuthorizedForApp(
string SecurityObjectName,
string ServerName,
bool AllowSecurityCache_Read,
bool AllowSecurityCache_Write
);
As you can see,
1. the parameter Optional ByVal ServerName As String
= , _ is missing the empty string ""
2. the C# statement hasn't got any information about
default values yet.
Thanks
Jochen
Logged In: YES
user_id=919791
1. Default string values were not being enquoted, so the
empty string was not visible...
Fix for MSDN and VS.NET documenters has been committed
to CVS.
2. C# does not support optional parms or default values.
Logged In: YES
user_id=1028390
Hi Kevin!
Your 2nd statement is not 100% correct: regarding MS C#
you may be right, regarding Mono C# those declarations are
possible and already used.
Here a short example from namespace
Microsoft.VisualBasic.Strings programmed in Mono C#:
...
[MonoTODO("Needs testing")]
public static string[] Filter(object[] Source,
string Match,
[Optional]
[DefaultValue(true)]
bool Include,
[OptionCompare] [Optional]
[DefaultValue(CompareMethod.Binary)]
CompareMethod Compare)
{
if (Source == null)
...
Regards
Jochen
Logged In: YES
user_id=919791
Mmmm, very interesting..
I ran a few experiments on this using MS C# and it turns out
that the compiler does use those attributes to create the
appropriate metadata.
So, C# can *create* methods that have optional parameters
and default values, even if it cannot use them :-)
NDoc 1.3 does not document parameter level attributes. I will
create an RFE for the next release, as it will require a
substantial amount of work; it's not just a simple bug fix