[Mono-dev] Parameter names and class status

Atsushi Eno atsushi at ximian.com
Fri Oct 20 17:39:28 EDT 2006


Hello,

I would love to see such cosmetic differences as totally optional
such as we do filter some attributes such as ComVisibleAttribute out
so that the class status pages do not become totally noisy for 99%
of people.

Atsushi Eno

Leszek Ciesielski wrote:
> On 10/20/06, Kornél Pál <kornelpal at gmail.com> wrote:
>> > Though I really want to use passing by name, I'm not convinced
>> > it's a good idea.
> 
> OK. The patch I submitted in the beginning works, I've just tested it
> on Microsoft.Build.Tasks. The glitch is that it requires regenerating
> the masterfiles (without this, every method with parameters is
> reported as an error). And I was unable to test the whole Class Status
> page, because this procedure :
> http://www.mono-project.com/Class_Status aborts with
> no rules to make 'src/class-status-Microsoft.VisualBasic.src' required
> by 'deploy/ado-net.html'.
> I generated a per-assembly status following this guide:
> http://www.mono-project.com/Generating_class_status_pages
> 
> As to the number of differences: as I said, I could not generate the
> whole status page. In the assembly I tested, there was one new
> inconsistency uncovered, which bodes well for the code in general.
> 
> After I read what Kornél Pál wrote about public metadata, I made
> another change to the corcompare/class-status generation feature.
> Class status used to check whether attributes match, I extended it to
> check if the values of the attributes match. Sometimes the differences
> reported are of small consequence (eg. different CompanyName), but
> other, such as attribute parameters from System.Xml.Serialization, may
> have an important impact on interoperability. Patch is attached,
> please review. Also attached is a simplified Makefile for producing
> masterfiles / api-info files.
> 
> 
> ------------------------------------------------------------------------
> 
> Index: mono-api-info.cs
> ===================================================================
> --- mono-api-info.cs	(wersja 66839)
> +++ mono-api-info.cs	(kopia robocza)
> @@ -910,9 +910,12 @@
>  					continue;
>  
>  				XmlNode node = document.CreateElement ("attribute");
> -				AddAttribute (node, "name", t.ToString ());
> +				StringBuilder name = new StringBuilder();
> +				name.Append (t.ToString ());
> +				name.Append ("(");
>  
>  				XmlNode properties = null;
> +				bool hasProperties = false;
>  				foreach (PropertyInfo pi in TypeData.GetProperties (t)) {
>  					if (pi.Name == "TypeId")
>  						continue;
> @@ -931,17 +934,31 @@
>  							AddAttribute (n, "null", "true");
>  							continue;
>  						}
> +						
> +						name.Append (pi.Name);
> +						name.Append (" = ");
> +						hasProperties = true;
>  
>  						string value = o.ToString ();
>  						if (t == typeof (GuidAttribute))
>  							value = value.ToUpper ();
>  
>  						AddAttribute (n, "value", value);
> +						name.AppendFormat ("{0}, ", value);
>  					}
>  					catch (TargetInvocationException) {
>  						continue;
>  					}
>  				}
> +				
> +				if (hasProperties)
> +					name.Length -= 2; // remove ", "
> +				name.Append (")");
> +				
> +				if (t.Name.EndsWith ("TODOAttribute")) //ignore MonoTODO
> +					AddAttribute (node, "name", t.ToString ());
> +				else				
> +					AddAttribute (node, "name", name.ToString ());
>  
>  				natts.AppendChild (node);
>  			}
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list