Re: [Mono-list] Question about attributes
Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Question about attributes
On Thu, 2004-04-29 at 07:56, [EMAIL PROTECTED] wrote: Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). You can do just the same with mono: using System; using System.ComponentModel; class MyTest { [Description(Test)] public void whatever() { } } Will work (i.e. compile) just fine. Whether or not it is any use is whether the tools you want to use can get at this information. The DescriptionAttribute is used for design time purposes (i.e. to display in the properties panel of a visual tool) rather than strictly for documentation, if you want to autogenerate documentation from your code you might me better of using the XML documentation comments rather than this. Of course you can create your own attributes by inheriting from System.Attribute as documented on MSDN and elsewhere. /J\ This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Question about attributes
Ok, so there is no recommendation about attributes to use in mono for documentation... I don't want using XML tags as it doesn't work with VB.Net by default (I think...) and you have to deliver : assembly and XML file ... So I will create some attributes ! Thanks for all the answer ! Thierry Selon Jonathan Stowe [EMAIL PROTECTED]: On Thu, 2004-04-29 at 07:56, [EMAIL PROTECTED] wrote: Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). You can do just the same with mono: using System; using System.ComponentModel; class MyTest { [Description(Test)] public void whatever() { } } Will work (i.e. compile) just fine. Whether or not it is any use is whether the tools you want to use can get at this information. The DescriptionAttribute is used for design time purposes (i.e. to display in the properties panel of a visual tool) rather than strictly for documentation, if you want to autogenerate documentation from your code you might me better of using the XML documentation comments rather than this. Of course you can create your own attributes by inheriting from System.Attribute as documented on MSDN and elsewhere. /J\ This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
AW: [Mono-list] Question about attributes
In the upcoming release of VB.NET 2005 of MS, those XML tags in VB are supported. You can already taste that in the VS.NET 2005 beta. The syntax is very similar to the C# writing style except that you use ''' instead of /// at the beginning of the line. Then you can build the DLL normally and the XML file can be created with the new VS.NET 2005. Alternatively and as I remember, there is a VBDoc project somewhere on sourceforge.net which might be able to extract those XML tags. -Jochen -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Donnerstag, 29. April 2004 13:35 An: [EMAIL PROTECTED]; Jonathan Stowe Betreff: Re: [Mono-list] Question about attributes Ok, so there is no recommendation about attributes to use in mono for documentation... I don't want using XML tags as it doesn't work with VB.Net by default (I think...) and you have to deliver : assembly and XML file ... So I will create some attributes ! Thanks for all the answer ! Thierry Selon Jonathan Stowe [EMAIL PROTECTED]: On Thu, 2004-04-29 at 07:56, [EMAIL PROTECTED] wrote: Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). You can do just the same with mono: using System; using System.ComponentModel; class MyTest { [Description(Test)] public void whatever() { } } Will work (i.e. compile) just fine. Whether or not it is any use is whether the tools you want to use can get at this information. The DescriptionAttribute is used for design time purposes (i.e. to display in the properties panel of a visual tool) rather than strictly for documentation, if you want to autogenerate documentation from your code you might me better of using the XML documentation comments rather than this. Of course you can create your own attributes by inheriting from System.Attribute as documented on MSDN and elsewhere. /J\ This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Question about attributes
I know that you can document your apps with monodoc related tools; there is a tool that can generate a set of XML files from your code, then you can fill this files with your documentation. Later you can keep the file structure updated with your code using another tool. Monodoc understands and can display documentation in this format. I don't know if there is some effort to create a translator from monodoc XML format to Microsoft XML documentation format. That would be nice, because one could use NDoc to generate files for Windows users. Does anyone knows about such a tool? Rodolfo From: [EMAIL PROTECTED] To: [EMAIL PROTECTED],Jonathan Stowe [EMAIL PROTECTED] Subject: Re: [Mono-list] Question about attributes Date: Thu, 29 Apr 2004 13:35:07 +0200 Ok, so there is no recommendation about attributes to use in mono for documentation... I don't want using XML tags as it doesn't work with VB.Net by default (I think...) and you have to deliver : assembly and XML file ... So I will create some attributes ! Thanks for all the answer ! Thierry Selon Jonathan Stowe [EMAIL PROTECTED]: On Thu, 2004-04-29 at 07:56, [EMAIL PROTECTED] wrote: Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). You can do just the same with mono: using System; using System.ComponentModel; class MyTest { [Description(Test)] public void whatever() { } } Will work (i.e. compile) just fine. Whether or not it is any use is whether the tools you want to use can get at this information. The DescriptionAttribute is used for design time purposes (i.e. to display in the properties panel of a visual tool) rather than strictly for documentation, if you want to autogenerate documentation from your code you might me better of using the XML documentation comments rather than this. Of course you can create your own attributes by inheriting from System.Attribute as documented on MSDN and elsewhere. /J\ This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list _ Add
Re: [Mono-list] Question about attributes
Rodolfo Campero wrote: I don't know if there is some effort to create a translator from monodoc XML format to Microsoft XML documentation format. That would be nice, because one could use NDoc to generate files for Windows users. Does anyone knows about such a tool? Since this has come up so many times, I'll work on it when I get the chance. (As I keep repeating on the docs list, the two formats are so similar that it would be trivial for anyone to learn XSLT, if necessary, and write the conversion themselves if they wanted it. It would also make a nice project if someone is looking for a way to contribute to Mono.) -- - Joshua Tauberer http://taubz.for.net ** Nothing Unreal Exists ** Rodolfo Campero wrote: I know that you can document your apps with monodoc related tools; there is a tool that can generate a set of XML files from your code, then you can fill this files with your documentation. Later you can keep the file structure updated with your code using another tool. Monodoc understands and can display documentation in this format. I don't know if there is some effort to create a translator from monodoc XML format to Microsoft XML documentation format. That would be nice, because one could use NDoc to generate files for Windows users. Does anyone knows about such a tool? Rodolfo From: [EMAIL PROTECTED] To: [EMAIL PROTECTED],Jonathan Stowe [EMAIL PROTECTED] Subject: Re: [Mono-list] Question about attributes Date: Thu, 29 Apr 2004 13:35:07 +0200 Ok, so there is no recommendation about attributes to use in mono for documentation... I don't want using XML tags as it doesn't work with VB.Net by default (I think...) and you have to deliver : assembly and XML file ... So I will create some attributes ! Thanks for all the answer ! Thierry Selon Jonathan Stowe [EMAIL PROTECTED]: On Thu, 2004-04-29 at 07:56, [EMAIL PROTECTED] wrote: Hi, First : Thanks for the explanation ;-) But my question what about which attributes using in order to document methods or function in my code. For example, if you want the Visual Studio .Net Property Panel to be able to display info about your properties you have to use System.ComponentModel.Description(The description). You can do just the same with mono: using System; using System.ComponentModel; class MyTest { [Description(Test)] public void whatever() { } } Will work (i.e. compile) just fine. Whether or not it is any use is whether the tools you want to use can get at this information. The DescriptionAttribute is used for design time purposes (i.e. to display in the properties panel of a visual tool) rather than strictly for documentation, if you want to autogenerate documentation from your code you might me better of using the XML documentation comments rather than this. Of course you can create your own attributes by inheriting from System.Attribute as documented on MSDN and elsewhere. /J\ This is a Visual Studio .Net rules. Now my question is : of I want to add documention to my methods, class etc... which meta-attributes do I use ? Maybe there is no dedicated attributes and I will have to create my owns... Thierry ! Selon Jonathan Pryor [EMAIL PROTECTED]: On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon
Re: [Mono-list] Question about attributes
Hi Joshua, I already know XSLT, so I will give it a shot this afternoon (it's 10:30 am here in Argentina, I will start working on it at 19:00). Also I will subscribe to mono-docs-list right now, so I will posts questions there if I have to. I would like to know who should I refer to when I get something usable, in order to make it part of mono or monodoc. Best regards, Rodolfo From: Joshua Tauberer [EMAIL PROTECTED] To: Rodolfo Campero [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [Mono-list] Question about attributes Date: Thu, 29 Apr 2004 09:21:26 -0400 Rodolfo Campero wrote: I don't know if there is some effort to create a translator from monodoc XML format to Microsoft XML documentation format. That would be nice, because one could use NDoc to generate files for Windows users. Does anyone knows about such a tool? Since this has come up so many times, I'll work on it when I get the chance. (As I keep repeating on the docs list, the two formats are so similar that it would be trivial for anyone to learn XSLT, if necessary, and write the conversion themselves if they wanted it. It would also make a nice project if someone is looking for a way to contribute to Mono.) -- - Joshua Tauberer http://taubz.for.net ** Nothing Unreal Exists ** _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Question about attributes
Rodolfo Campero wrote: I already know XSLT, so I will give it a shot this afternoon Great! I would like to know who should I refer to when I get something usable, in order to make it part of mono or monodoc. Just post it to the docs list for everyone to take a look at. -- - Joshua Tauberer http://taubz.for.net ** Nothing Unreal Exists ** ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Question about attributes
Hi ! I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... Thanks for any help ! -- Xiii29 [EMAIL PROTECTED] ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Question about attributes
On Wed, 2004-04-28 at 16:46, Xiii29 wrote: I've question about attributes in Mono. I would like to comment my assemblys by using attributes (meta-attributes...) and i'm wondering if there is rules (or preconisations...) about which attributes using... I'm pretty sure I don't understand your question at all. But I'll take a shot anyway... To use an assembly-level attribute, you need to explicitly specify what the attribute is associated with. For example: [assembly: AssemblyTitle (my title)] [assembly: AssemblyVersion (1.0.*)] The assembly: indicates that the attribute applies to the assembly. Otherwise it would apply to the next member listed in the file (delegate, class, structure, etc.) or generate an error (namespaces don't support attributes). Similar things can be done for other elements; for example: return: can be used to place an attribute on the return type of a method, while normally the attribute applies to the method itself: [SomeAttribute (applies to MyMethod)] [return: SomeAttribute (applies to the return type)] int MyMethod () {return 42;} As for general rules... You can only use attributes which can be applied to an assembly; that is, the attribute you're trying to use must itself have an AttributeUsage attribute with AttributeTargets.Assembly specified. Not all attributes do this; the DllImport attribute, for example, can only be applied to methods. Aside from that, the normal attribute restrictions apply. Which means that attribute positional and named parameters can only be: one of the CLS-compliant built-in types (bool, byte, char, double, float, int, long, short, string); System.Type, an enum type; System.Object; or an array of one of the previous types. See a good C# book, or MSDN, or google, for more information. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list