[Mono-dev] Fixes for System.Net.Mail
Paolo Molaro
lupus at ximian.com
Mon Dec 4 13:24:37 EST 2006
On 12/03/06 David Elkin wrote:
> I am new to this list. My name is David Elkind and I am part of Mainsoft team.
Welcome:)
> Please review my change to the System.Net.Mail classes and related configurationi
> 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 (StringComparer.InvariantCultureIgnoreCase);
> +#else
> + mimeTypes = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
> + CaseInsensitiveComparer.DefaultInvariant);
> +#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.
Thanks.
lupus
--
-----------------------------------------------------------------
lupus at debian.org debian/rules
lupus at ximian.com Monkeys do it better
More information about the Mono-devel-list
mailing list