[Mono-list] Compilation Error regarding Constraints

2005-05-25 Thread Christian Gross
Consider the following source code:

interface IBase {
void Method< type>( type param);
}

class Implementation : IBase {
public void Method< paramtype>( paramtype param) {

}
}

If I compile this source code everything compiles fine in one assembly.  If I 
move the interface IBase 
into another assembly I get a compilation error, even though on Windows Beta 2 
everything 
compiles.  The error that I get is:

The constraints for type parameter `paramtype' of method 
`Implementation.Method( paramtype)' 
must match the constraints for type parameter `type' of interface method 
`IBase.Method(type)'.  
Consider using an explicit interface implementation instead

Could somebody please tell me how come this does not compile?

Thanks

Christian Gross

--

"If you could say it in words there would be no reason to paint."
Edward Hopper

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Possible Bug?

2005-04-27 Thread Christian Gross
Consider the following class declaration.

internal class PluginBase {
private string _path;

public PluginBase( string path ) {
_path = path;
}

public instanceType CreateInstance( 
string assemblyidentifier, 
string typeidentifier ) where instanceType : class
where instanceType : class {
Assembly assembly;
assembly = Assembly.Load( AssemblyName.GetAssemblyName( _path ) );
if( assembly != null ) {
return (assembly.CreateInstance( typeidentifier )) 
as instanceType;
}
}
}
}

This code compiles in .NET

When I attempt to compile with Mono from SVN I get the following error.

/Users/cgross/Desktop/projects/oop-using-net-patterns/src/Chap05.TranslationDefinitions/definitions.cs(33)
error CS0077: The as operator should be used with a reference type only
(instanceType is a value type)

Should this not compile?

Thanks

Christian Gross

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Gtk# or the future Windows.Forms Mono

2005-04-16 Thread Christian Gross
Jonathan Pryor wrote:
This isn't entirely true; there is also development on Cocoa# for better
Mac OS X integration.
 

Well, does this not make the argument for something like wx.NET, which
already has pretty decent OSX integration including native look and feel?
So the closest to an "official" position would probably be this: design
your code to utilize multiple different front-ends so that you can
better integrate with all of your target platforms.  This implies having
Gtk#, SWF, and Cocoa# GUIs, if desired.  Is this more work?  Yes.  But
your users will prefer it.  (For proof, just see the history of cross-
platform toolkits between Mac OS and Windows.  The users tended to
prefer Mac-native front-ends in almost all cases.  Even now, I hear
grumbling from users that Qt programs don't look "quite right" on the
Mac, because buttons are the wrong size and other subtle issues.)
 

Yes, you are right, and why I point out wx.NET as it is a native look
and feel.
Well, if you are comparing C++ toolkits and their issues, sure you have
a point.  But Java Swing has managed to create native look and feel
applications across all platforms.  I think asking a client to use
different GUI toolkits on different platforms is asking too much.
Playing devils advocate, I suppose at that point my reaction would be,
ok, fine, so who pays the software development bills?  Windows!  Hence
it makes sense to code to only Windows and forget the rest.  Which at
that point raises the question of why Mono?  I suppose an answer would
be easier development on Linux.  Which is acceptable, but if a Linux app
does not look and feel good on Windows or OSX, why bother?  I am just
playing devils advocate here, and find that using an approach like
wx.NET I avoid all of these problems in the first place.
A question is why not work on making GTK having a native look and feel?
I was looking at gtk-osx native port and it seemed to have been stopped
in 2002.  Why did it stop?
Just asking questions and wondering...
Christian Gross
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Gtk# or the future Windows.Forms Mono

2005-04-15 Thread Christian Gross
Dilton McGowan II wrote:
Should developers consider Gtk# or the new Mono
Windows.Forms (or whatever it will be called) in
planning and design phases for new GUI projects?
 

If I may add an third option.  I find the wx.NET 
(http://wxnet.sourceforge.net) option to be very interesting as it uses 
wxWidgets.  The major reason why I like it is that wxWidgets is a mature 
library that gives a native look and feel on multiple platforms (OSX, 
Windows, and Linux).

Christian Gross
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list