[Mono-dev] Fixes for System.Net.Mail

David Elkind davide at mainsoft.com
Tue Dec 5 13:08:13 EST 2006


	I have fixed the indentations issue (almost completely), so you can
now review the real changes. Please also note that in the example you have
quoted, there WERE real changes (default values added for the properties). 

Regarding the Mime-types hash table - I have copied the code from System.Web
as is, in order to avoid build dependency of System on System.Web. If you
feel this needs to be improved (and I tend to agree), I think the bug should
be added to Bugzilla in order to take a correct decision on the best way to
remove duplication and the best way to implement this functionality.

Meanwhile, I am waiting for the review :)

Thanks a lot,

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Paolo Molaro
Sent: Monday, December 04, 2006 8:25 PM
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] Fixes for System.Net.Mail

On 12/03/06 David Elkin wrote:
> I am new to this list. My name is David Elkind and I am part of Mainsoft


> Please review my change to the System.Net.Mail classes and related
> classes from System.Net.Configuration.

> Index: System.Net.Configuration/SmtpNetworkElement.cs
> ===================================================================
> --- System.Net.Configuration/SmtpNetworkElement.cs	(revision 68672)
> +++ System.Net.Configuration/SmtpNetworkElement.cs	(working copy)
> @@ -47,10 +47,10 @@
>                  static SmtpNetworkElement ()
>                  {
>                          defaultCredentialsProp = new
ConfigurationProperty ("defaultCredentials", typeof (bool), false);
> -                        hostProp = new ConfigurationProperty ("host",
typeof (string));
> -                        passwordProp = new ConfigurationProperty
("password", typeof (string));
> -                        portProp = new ConfigurationProperty ("port",
typeof (int), 25);
> -                        userNameProp = new ConfigurationProperty
("userName", typeof (string));
> +                        hostProp = new ConfigurationProperty ("host",
typeof (string), null);
> +						passwordProp = new
ConfigurationProperty ("password", typeof (string), null);
> +                        portProp = new ConfigurationProperty ("port",
typeof (int), 25);
> +						userNameProp = new
ConfigurationProperty ("userName", typeof (string), null);
>                          properties = new ConfigurationPropertyCollection

There is no need to indent here. Also, almost half of you patch is made
of gratuitous reformatting changes. Please resend without them so we
can actually review the changes.

> Index: System.Net.Mail/AttachmentBase.cs
> ===================================================================
> --- System.Net.Mail/AttachmentBase.cs	(revision 68672)
> +++ System.Net.Mail/AttachmentBase.cs	(working copy)
> +		private class MimeTypes
> +		{
> +			static Hashtable mimeTypes;
> +
> +			static MimeTypes () {
> +#if NET_2_0
> +				mimeTypes = new Hashtable
> +#else
> +			    mimeTypes = new Hashtable
> +
> +#endif
> +
> +				mimeTypes.Add ("3dm", "x-world/x-3dmf");

I believe this would be at least the third implementation of this code:
this looks like a copy of the same class from system.Web and
System.Windows.Forms has its own implementation, too which loads the
data from files. We need an efficient implementation here
(especially memory-wise).
Question: is the SWF good enough to be put into System.dll and be
invoked from System.Web, SWF and for this mail class?
Or should we add an icall so we implement this stuff using the operating
system API or a C implementation? What is quite clear to me is that we
should not use an hashtable with all the entries which is kept in memory
all the time.


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.6/568 - Release Date: 12/4/2006
3:20 PM

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/571 - Release Date: 12/5/2006
11:50 AM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail_and_config_v2.patch
Type: application/octet-stream
Size: 51118 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061205/88585f8b/attachment.obj 

More information about the Mono-devel-list mailing list