[Mono-winforms-list] How to use Metafile.
Hello Everybody, I am using Metafile with vb.net i have generate the problem with Metafile to MONO. Metafile is not working with MONO Framework. So Please Suggest me High Resolution Image Printing. Thanks Anubhava Dimri -- View this message in context: http://mono.1490590.n4.nabble.com/How-to-use-Metafile-tp3044570p3044570.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-winforms-list] How to use Metafile.
If your project can be AGPL licensed or you can pay their commercial license, the best thing to generate high qualitty printable results is iText# Home: http://itextpdf.com/ Download: http://sourceforge.net/projects/itextsharp/files/. You generate a PDF with iText and then you can either print directly in Linux, or call any pdf-printing software in Windows/Mac (Adobe or else). Another possibility is the SVG format. (Se http://www.codeproject.com/KB/cs/svgnet.aspx, for example). I migrated the svgnet code to github repo: https://github.com/monoman/SvgNet Metafiles is windows specific, proprietary and very badly documented, so avoid them for anything that means to be portable. Hope it helps, Rafael Monoman Teixeira --- We live in a world operated by science and technology. We have also arranged things so that almost no one understands science and technology. This is a prescription for disaster. We might get away with it for a while, but sooner or later this combustible mixture of ignorance and power is going to blow up in our faces. -Carl Sagan On Tue, Nov 16, 2010 at 8:39 AM, Anubhava Dimri anubhava.prod...@gmail.com wrote: Hello Everybody, I am using Metafile with vb.net i have generate the problem with Metafile to MONO. Metafile is not working with MONO Framework. So Please Suggest me High Resolution Image Printing. Thanks Anubhava Dimri -- View this message in context: http://mono.1490590.n4.nabble.com/How-to-use-Metafile-tp3044570p3044570.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - mono-winforms-l...@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
[Mono-aspnet-list] Can't install XSP as daemon on Debian
Hi, everybody. I ran into next problem: After building and installing of new version of XSP (from git master, 14 nov and 14 sept accordingly) it doesn't run as a daemon and brings the system into non-operable condition (it can't boot). It looks like this: other daemons start xsp Listening on address: 0.0.0.0 Root directory: /home/godfather/Projects/Test Listening on port: 80 (non-secure) And that's all. The system is stucked and only recovery mode helps. I'm installing it next way: $ sudo cp /etc/init.d/skeleton /etc/init.d/xsp PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=Mono XSP4 NAME=xsp4 DAEMON=/usr/bin/$NAME DAEMON_ARGS=--port 80 --nonstop --root /home/godfather/Projects/Test PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME $ sudo update-rc.d xsp defaults Is it XSP bug? Alex ___ Mono-aspnet-list mailing list Mono-aspnet-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
Re: [Mono-aspnet-list] Socket.Exception running xsp, mod-mono-server on Debian Lenny
I figured it out it is the issue with the HEAD build of xsp. Where should i post this as a bug? On Mon, Nov 15, 2010 at 5:24 PM, Sergey Lobko-Lobanovsky serge.lobanov...@gmail.com wrote: Hello folks, I've run into a very strange problem. When I try to run either XSP, or mod-mono-server, or mod_mono via Apache, I get the following exception on Debian Lenny: localhost:~# mod-mono-server mod-mono-server2 Listening on: /tmp/mod_mono_server Root directory: /root Hit Return to stop the server. Handling exception type SocketException Message is Operation on non-blocking socket would block IsTerminating is set to True System.Net.Sockets.SocketException: Operation on non-blocking socket would block at System.Net.Sockets.Socket.Accept (System.Net.Sockets.Socket acceptSocket) [0x0] in filename unknown:0 at System.Net.Sockets.SocketAsyncEventArgs.AcceptCallback () [0x0] in filename unknown:0 I seem to have tried everything I could google, with no avail. Could someone point me to the solution to this? I have: 1) Mono 2.8.1 mod_mono compiled from source and installed in /usr/local 2) Apache2 from the lenny-backports repo 3) Debian 5 The very same setup is working fine on my Ubuntu 10.04 machine. Any help would be much appreciated! Sergey. ___ Mono-aspnet-list mailing list Mono-aspnet-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
[Mono-dev] Mono.Options
Hi, Is Mono.Options switched off in the 2.8 tarball? I'm not seeing it getting packaged at the end of the build (either with a RPM script or as a direct build) Paul -- Vertraue mir, ich weiss, was ich mache... ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [PATCH] malloc.h deprecated ?
Applied, thanks. Zoltan On Tue, Nov 16, 2010 at 7:03 AM, KISHIMOTO, Makoto ksmak...@dd.iij4u.or.jpwrote: Hello. Please apply this patch. diff --git a/mono/profiler/decode.c b/mono/profiler/decode.c index a7d4428..6cc08ff 100644 --- a/mono/profiler/decode.c +++ b/mono/profiler/decode.c @@ -12,7 +12,7 @@ #include string.h #include assert.h #include stdio.h -#if !defined(__APPLE__) +#if !defined(__APPLE__) !defined(__FreeBSD__) #include malloc.h #endif #include unistd.h On Sat, 13 Nov 2010 17:21:24 +0900 KISHIMOTO, Makoto ksmak...@dd.iij4u.or.jp wrote: Hello, In my FreeBSD-amd64 box, Mono git trunk build failed. IMHO, malloc.h had been deprecated in my environment. $ gmake (snip) gcc -DHAVE_CONFIG_H -I. -I../../../mono/mono/profiler -I../.. -fexceptions -DMONO_USE_EXC_TABLES -I../../../mono -I../../../mono/eglib/src -I../../eglib/src -DGC_FREEBSD_THREADS -DPLATFORM_BSD -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -mno-tls-direct-seg-refs -MT decode.o -MD -MP -MF .deps/decode.Tpo -c -o decode.o ../../../mono/mono/profiler/decode.c In file included from ../../../mono/mono/profiler/decode.c:16: /usr/include/malloc.h:3:2: error: #error malloc.h has been replaced by stdlib.h ../../../mono/mono/profiler/decode.c: In function 'tracked_creation': ../../../mono/mono/profiler/decode.c:993: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has type 'uint64_t' ../../../mono/mono/profiler/decode.c: In function 'decode_buffer': ../../../mono/mono/profiler/decode.c:1082: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'intptr_t' (snip warnings) gmake[3]: *** [decode.o] Error 1 gmake[3]: Leaving directory `/export/home/ksmakoto/Mono/BUILD/mono/profiler' gmake[2]: *** [all-recursive] Error 1 gmake[2]: Leaving directory `/export/home/ksmakoto/Mono/BUILD/mono' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/export/home/ksmakoto/Mono/BUILD' gmake: *** [all] Error 2 ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Mono.Options
On Tue, 2010-11-16 at 08:44 +, Paul F. Johnson wrote: Is Mono.Options switched off in the 2.8 tarball? I'm not seeing it getting packaged at the end of the build (either with a RPM script or as a direct build) I'm unable to reproduce; specifically, I built and installed the sources from [0] on openSUSE 11.2, and $prefix/lib/mono-source-libs/Options.cs is present. mono-2.8/mono.spec also includes a line to bundle the $prefix/lib/mono-source-libs directory into mono-devel package: mono-core.spec:1039: %_prefix/lib/mono-source-libs I have no idea why you're not seeing this packaged. - Jon [0] http://ftp.novell.com/pub/mono/sources/mono/mono-2.8.tar.bz2 ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] C# source-to-source compiler
Hello, I just noticed this thread, and I'm curious, when you say: The async/await is about asynchrony and spawn/sync is about parallelism. These are 2 different things which should not be mixed together. Do you mean they should not be confused, or do you literally mean that these technologies (or paradigms, if you will) should not be combined? If this is the case, I'm curious to learn why you say that, since I'm toying with idea of hybrid threading for a concurrency framework I'm working on (https://github.com/nirvanai/Cirrus). I don't see any problem combining these two together when needed, my point was simply that they mean 2 different things. Mono C# compiler has no async support yet (the .NET preview has been announced few days ago!) but we are fully aware of it and we will implement it as soon as time permits. I implemented async methods (before I knew they were to be a language feature) using Cecil for the framework I mentioned. I think the coroutine transformation I'm doing is pretty similar to the way Microsoft is doing things in their async preview. I'd certainly be willing to take a stab at adding async support to the Mono C# compiler if/when you think that might be beneficial. Patches are always welcomed. However, the approach will be different as the rewrite will happen at expression level (you don't need Cecil). Marek ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Porting db4o-tool to use Mono.Options rather than Mono.GetOption
Hi, I'm working out some bugs in db4o so that the upcoming version 8.0 will build out of the box on mono. Currently, it ships with its own version of Cecil, CecilFlowAnalysis and GetOptions. While I can live with the Cecil bits and pieces, GetOptions is dead in the water with mono-2.8 and (from what I can see) has been fazed out since mono-2.2 so rather than continue to support it, I'm trying to port it over to use Mono.Options. Okay, the pre-packaged Cecil stuff will cause me problems with building for Fedora, but that's another story. My only problem is that I can't see an equivalent of return WhatToDoNext.GoAhead; in Mono.Options. Is there such a beastie and if there is, what is it called? TTFN Paul -- Vertraue mir, ich weiss, was ich mache... ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Mono Sybase client
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Does mono 2.4 or 2.6 on Linux really work with Sybase ASE (I use 15.5)? I just tested with the below code, and I am not able to establish a connection to my ASE 15.5 database. Connection refused. Since sa had a blank password, I thought it might be the pw, so I created an additional user, but that didn't help. But I can without problem connect to the DB using SybaseCentral with exactly this username + pw + port + hostname. I get an exception right at dbcon.open using System; using System.Web; using System.Web.UI; namespace TestGridView { public partial class Default : System.Web.UI.Page { public void SybaseTest() { string connectionString = Server=IS1300,5000; + Database=master; + User ID=SomeUser; + Password=SomePassword;; // from connectionstrings.com. doesn't work either connectionString = Data Source='IS1300';Port=5000;Database=master;Uid=SomeUser;Pwd=SomePassword;; //System.Data.IDbConnection dbcon; Mono.Data.SybaseClient.SybaseConnection dbcon; dbcon = new Mono.Data.SybaseClient.SybaseConnection(connectionString); try { dbcon.Open(); System.Data.IDbCommand dbcmd = dbcon.CreateCommand(); string sql = SELECT name + FROM master.dbo.sysobjects; dbcmd.CommandText = sql; System.Data.IDataReader reader = dbcmd.ExecuteReader(); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.DataTable dt = new System.Data.DataTable(); Mono.Data.SybaseClient.SybaseDataAdapter myad = new Mono.Data.SybaseClient.SybaseDataAdapter(sql, dbcon); //myad.SelectCommand.CommandText = sql ; myad.Fill(dt); GridView1.DataSource = dt.DefaultView; GridView1.DataBind(); while(reader.Read()) { string objName = reader[name].ToString(); Console.WriteLine(Name: + objName); } // clean up reader.Close(); reader = null; dbcmd.Dispose(); dbcmd = null; dbcon.Close(); dbcon = null; } catch(Exception ex) { Response.Write(error: + ex.Message); } } public virtual void button1Clicked (object sender, EventArgs args) { SybaseTest(); button1.Text = You clicked me; /* System.Data.DataSet myds = new System.Data.DataSet(); string strConnectionString =; Mono.Data.SybaseClient.SybaseConnection xxx = new Mono.Data.SybaseClient.SybaseConnection(strConnectionString); //Mono.Data.SqliteClient.SqliteConnection xxx = new Mono.Data.SqliteClient.SqliteConnection(strConnectionString); //System.Data.SqlClient.SqlConnection = new System.Data.SqlClient.SqlConnection(strConnectionString); //GridView1.DataSource = */ } } } -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJM4xQTAAoJEKkS8c1rnvHc1WkH/3eSTEF60LgPS8mv01ajDrS+ JGITR3dAzxjXidfUFDVoMS8JsWTtSaGEGhtr6W87NeVv4Oev+X/3TqEY0TnP6hB/ SMFrblvELNb76MA2opUoki2h/WQwAjQljLFd3HkfYxXzfkmM9tL4w4GY4bt1M4fL odpHKBvzndwmrhavfoWVbxHAnNxCcE3S+8VYPVRtam0tul11RgSsXycHJkY3CDIO rQShRO514VzAhUhkCw+gUS5q3Trpcb7QDuXAw4p9L3etQz8E4X7sFqOs5ccqzXwV sbFZALHtwCZeMbccsuD2YUVK0ycRJPHdKs69aiH4tn88E7Z25h4rahv+tu8pjlc= =5NEy -END PGP SIGNATURE- ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] How to get the Volume UUID on MAC
Hi, Is there any way to get the Volume UUID on a Mac using mono. On windows one would usually resort to platform invoke on KERNEL32.dll to GetVolumeInformation(). The DriveInfo class seems to not help.. Thanks in advance -Vinay -- View this message in context: http://mono.1490590.n4.nabble.com/How-to-get-the-Volume-UUID-on-MAC-tp3046197p3046197.html Sent from the Mono - Dev mailing list archive at Nabble.com. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-list] DrawingArea needs to redraw signal??
Hello, Currently I'm handling the ExposeEvent -as Miguel de Icaza told me in a prior answer- but I ignored that there're another way to do the same. I assume that overriding OnExpose is not available through Monodevelop interface designer, isn't it? So I should do something like: drawingarea1.OnExpose += MyOnExposeMethodDelegate am I right? Thanks a lot, El 16/11/10 00:46, Michael Hutchinson escribió: Override OnExpose or handle the ExposeEvent event and inspect the args.Event value. There you will find the invalidated region, and a Window drawable. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Text on Cairo
Hello there, I'm currently fighting with Cairo's text system, and I should to admit that I've a slight headache... The main problem that I've is that, for coherence, I would like to specify a point (as a pair of x,y coords) and the text should be drawn taken that point like the top-left point of the text. I think I must use TextExtents and/or FontExtents for this purpouse, but I didn't figure out HOW. There's an explanation in this tutorial: http://www.mono-project.com/Mono.Cairo_Tutorial#Understanding_Text But unfortunatly the code is missing. Does someone has some code on this issue that he/she dont mind to share??? Thanks a lot in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] NotImplemented error creating WCF ServiceHost
I am converting our current Windows WCF web service to mono. When I try to instantiate our ServiceHost object... ServiceHost selfHost = new ServiceHost(typeof([WebServiceClass]); I get a not implemented error. I figured this is due to something in the existing web service that is not implemented (reasonable). Because I can not find anything in there, I created a new class with no methods, and tried to use it in place of our web service... same error. From this it seems that the error is coming from the ServiceHost ctor itself. Am I missing a compiler key of some sort? I am working with monoTools for Visual Studio to build/debug. Here is the text of the error (sorry for the length): == Unhandled Exception: System.NotImplementedException: The requested feature is no t implemented. at System.Configuration.ConfigurationElement.get_EvaluationContext () [0x0 ] in filename unknown:0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].System.ServiceModel.Configuration.IConfigurationC ontextProviderInternal.GetEvaluationContext () [0x0] in filename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.GetEvaluationContext (IConfigurationContextProviderInternal provider) [0x0] in filename unknown :0 at System.ServiceModel.Configuration.EvaluationContextHelper.GetOriginalContex t (IConfigurationContextProviderInternal owner) [0x0] in filename unknown: 0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].System.ServiceModel.Configuration.IConfigurationC ontextProviderInternal.GetOriginalEvaluationContext () [0x0] in filename un known:0 at System.ServiceModel.Configuration.ConfigurationHelpers.GetOriginalEvaluatio nContext (IConfigurationContextProviderInternal provider) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.EvaluationContextHelper.OnReset (System.C onfiguration.ConfigurationElement parent) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].Reset (System.Configuration.ConfigurationElement parentElement) [0x0] in filename unknown:0 at System.Configuration.PropertyInformation.Reset (System.Configuration.Proper tyInformation parentProperty) [0x0] in filename unknown:0 at System.Configuration.ElementInformation.Reset (System.Configuration.Element Information parentInfo) [0x0] in filename unknown:0 at System.Configuration.ConfigurationElement.Reset (System.Configuration.Confi gurationElement parentElement) [0x0] in filename unknown:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] in filename unkno wn:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] in filename unkno wn:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] in filename unkno wn:0 at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x0] in filename unknown:0 at System.Configuration.Configuration.GetSection (System.String path) [0x0 ] in filename unknown:0 at System.Configuration.ClientConfigurationSystem.System.Configuration.Interna l.IInternalConfigSystem.GetSection (System.String configKey) [0x0] in filen ame unknown:0 at System.Configuration.ConfigurationManager.GetSection (System.String section Name) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSectionFrom ConfigurationManager (System.String sectionPath) [0x0] in filename unknown :0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedS ection (System.Configuration.ContextInformation evalContext, System.String secti onPath) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSection (Sy stem.String sectionPath) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.CommonBehaviorsSection.UnsafeGetSection ( ) [0x0] in filename unknown:0 at System.ServiceModel.Description.ConfigLoader.LookupCommonBehaviors (System. Configuration.ContextInformation context) [0x0] in filename unknown:0 at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription (System .ServiceModel.ServiceHostBase host, System.ServiceModel.Description.ServiceDescr iption description, System.ServiceModel.Configuration.ServiceElement serviceElem ent, System.Action`1 addBaseAddress) [0x0] in filename unknown:0 at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal (Syste m.ServiceModel.Description.ConfigLoader configLoader, System.ServiceModel.Descri
[Mono-list] Calling a constructor from within another's code
Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] DrawingArea needs to redraw signal??
On Tue, Nov 16, 2010 at 6:09 AM, Francisco M. Marzoa fmmar...@gmx.net wrote: Hello, Currently I'm handling the ExposeEvent -as Miguel de Icaza told me in a prior answer- but I ignored that there're another way to do the same. I assume that overriding OnExpose is not available through Monodevelop interface designer, isn't it? So I should do something like: drawingarea1.OnExpose += MyOnExposeMethodDelegate You may also wish to use [ConnectBefore] on your event handler, and set RetVal to true, so that the default handler doesn't get called. All the GTK built-in behaviors are implemented as event handlers, but GTK offers a way to stop events from propagating to other handlers (set RetVal to true), so built-in handlers often swallow events. You can use ConnectBeforeAttribute to insert handlers before the built-ins. Note also that you should use the Drawable object from the expose event's Window property, not the widget's GdkWindow property. This is a temporary double-buffered surface. -- Michael Hutchinson http://mjhutchinson.com ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Calling a constructor from within another's code
You could always move the base constructor code to a protected method and call it from the derived class constructor. public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); this.InitStuff( data.a, data.b ); } } *shrugs* fran wrote: Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list -- View this message in context: http://mono.1490590.n4.nabble.com/Calling-a-constructor-from-within-another-s-code-tp3045423p3045453.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Calling a constructor from within another's code
Hi Stifu, Thanks. Then I assume that there's no official manner of calling the base constructor within the new class one appart from the : base (...), isn't it? Regards, El 16/11/10 19:54, Stifu escribió: You could always move the base constructor code to a protected method and call it from the derived class constructor. public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); this.InitStuff( data.a, data.b ); } } *shrugs* fran wrote: Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Calling a constructor from within another's code
Hi, using System; namespace Thing { class MainClass { public static void Main (string[] args) { Console.WriteLine (Hello World!); } } public class Circle : Shape { public Circle () : this( new int[]{ 1,2 } ){ } private Circle ( int[] pair ) : base ( pair[0], pair[1] ) { } } public class Shape { public Shape ( int mass, int id ) { Console.WriteLine( mass {0} id {1}, mass, id ); } } } On Tue, 2010-11-16 at 18:35 +, Francisco M. Marzoa wrote: Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Calling a constructor from within another's code
I don't think so. It's the same in Java, the super() call must be the first instruction. fran wrote: Hi Stifu, Thanks. Then I assume that there's no official manner of calling the base constructor within the new class one appart from the : base (...), isn't it? Regards, El 16/11/10 19:54, Stifu escribió: You could always move the base constructor code to a protected method and call it from the derived class constructor. public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); this.InitStuff( data.a, data.b ); } } *shrugs* fran wrote: Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list -- View this message in context: http://mono.1490590.n4.nabble.com/Calling-a-constructor-from-within-another-s-code-tp3045423p3045505.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] How can I copy one drawable into another?
Hello, I've a Gtk.Image widget with a given content and I just want to copy that content within a Gtk.DrawingArea, is this possible in an easy manner? Thanks in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Calling a constructor from within another's code
Hi, I should have explained my earlier example a bit better, Here Goes; public class C : B { public C() : this( new GetDataFromTheDatabase() ) {} private C( GetDataFromTheDatabase data ) : base( data.a, data.b ){} } This takes advantage of the fact that you can chain into other constructors in your class. Regards Ian On Tue, 2010-11-16 at 18:35 +, Francisco M. Marzoa wrote: Hello, I know you can call a base class constructor using : base after the new constructor signature. I.e.: public class A { int i; public A (int _i) { i=_i; } } public class B : A { public B (int a, int b) : base (a+b) // Calls A constructor with _i as _a+_b { } } But what happens if you should made some more complicated that cannot be done in that way??? For example: public class C : B { public C () { MyDataStruct data = GetDataFromTheDatabase (); base ( data.a, data.b ); // This will not work, indeed, but illustrates the idea... } } This is a question more focused on C# than in mono itself, but I hope not to disturb no one doing it here since the list has not very high trafic. Best regards, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] How can I copy one drawable into another?
Hi Francisco, If you have a png on disk, this is done like so: void PaintImage( Context ctx, ImageSurface img, int x, int y ){ img.Show( ctx, x, y ); } ... ImageSurface image = new ImageSurface( filename ); PaintImage( ctx, image, 10, 20 ); If you have a Gtk.Image and want to turn it into a Cairo ImageSurface then you at the moment have to do something horrible like this: Gtk.Image myImage; ... Gdk.PixBuf buf = myImage.PixBuf; buf.Save( temp_convert,png ); ImageSurface image = new ImageSurface ( temp_convert ); Regards Ian On Tue, 2010-11-16 at 19:29 +, Francisco M. Marzoa wrote: Hello, I've a Gtk.Image widget with a given content and I just want to copy that content within a Gtk.DrawingArea, is this possible in an easy manner? Thanks in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] How can I copy one drawable into another?
Once you have it in a PixBuf, just paint it onto your ImageSurface: using (Cairo.Context g = new Cairo.Context (mySurface)) { g.DrawPixbuf (mypixbuf, new Cairo.Point (0, 0)); } Jonathan On 11/16/2010 2:28 PM, Ian Norton wrote: Hi Francisco, If you have a png on disk, this is done like so: void PaintImage( Context ctx, ImageSurface img, int x, int y ){ img.Show( ctx, x, y ); } ... ImageSurface image = new ImageSurface( filename ); PaintImage( ctx, image, 10, 20 ); If you have a Gtk.Image and want to turn it into a Cairo ImageSurface then you at the moment have to do something horrible like this: Gtk.Image myImage; ... Gdk.PixBuf buf = myImage.PixBuf; buf.Save( temp_convert,png ); ImageSurface image = new ImageSurface ( temp_convert ); Regards Ian On Tue, 2010-11-16 at 19:29 +, Francisco M. Marzoa wrote: Hello, I've a Gtk.Image widget with a given content and I just want to copy that content within a Gtk.DrawingArea, is this possible in an easy manner? Thanks in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Text on Cairo
Hi Francisco, As far as I know, text extends are to work out where the boundaries of your text will be after you write it, this is useful if you want to put several strings next to each other ( eg, write the next word or next line ). You would use the extends to find out how many cairo pixels tall the string would be. If you just want to print one string of text starting at a particular location on screen and don't need to know how wide or tall it ends up then you can safely do this:- public void StringAt( Context ctx, string str, int x, int y ) { ctx.NewPath(); ctx.Color = new Color( 0, 0, 0, 1 ); ctx.SetFontSize(12); ctx.MoveTo(x,y); ctx.ShowText(str); } If you wanted to use extents to find the boundaries of your text you might do this: public void StringsInRows( Context ctx, string[] strlist, int x, int y ) { var next_y = y; // print strings in lines foreach ( var str in strlist ){ ctx.NewPath(); ctx.Color = new Color( 0, 0, 0, 1 ); ctx.SetFontSize(12); ctx.MoveTo(x,next_y); var extent = ctx.TextExtents(str); next_y += (extent.Height + 5); // next line will be 5px under this line ctx.ShowText(str); } } Hope that helps Regards Ian On Tue, 2010-11-16 at 17:21 +, Francisco M. Marzoa wrote: Hello there, I'm currently fighting with Cairo's text system, and I should to admit that I've a slight headache... The main problem that I've is that, for coherence, I would like to specify a point (as a pair of x,y coords) and the text should be drawn taken that point like the top-left point of the text. I think I must use TextExtents and/or FontExtents for this purpouse, but I didn't figure out HOW. There's an explanation in this tutorial: http://www.mono-project.com/Mono.Cairo_Tutorial#Understanding_Text But unfortunatly the code is missing. Does someone has some code on this issue that he/she dont mind to share??? Thanks a lot in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] How can I copy one drawable into another?
On Tue, 2010-11-16 at 20:43 +, Jonathan Pobst wrote: Once you have it in a PixBuf, just paint it onto your ImageSurface: using (Cairo.Context g = new Cairo.Context (mySurface)) { g.DrawPixbuf (mypixbuf, new Cairo.Point (0, 0)); } Ooh, handy. Perhaps someone needs to update http://www.mono-project.com/Mono.Cairo_Cookbook. Regards Ian Jonathan On 11/16/2010 2:28 PM, Ian Norton wrote: Hi Francisco, If you have a png on disk, this is done like so: void PaintImage( Context ctx, ImageSurface img, int x, int y ){ img.Show( ctx, x, y ); } ... ImageSurface image = new ImageSurface( filename ); PaintImage( ctx, image, 10, 20 ); If you have a Gtk.Image and want to turn it into a Cairo ImageSurface then you at the moment have to do something horrible like this: Gtk.Image myImage; ... Gdk.PixBuf buf = myImage.PixBuf; buf.Save( temp_convert,png ); ImageSurface image = new ImageSurface ( temp_convert ); Regards Ian On Tue, 2010-11-16 at 19:29 +, Francisco M. Marzoa wrote: Hello, I've a Gtk.Image widget with a given content and I just want to copy that content within a Gtk.DrawingArea, is this possible in an easy manner? Thanks in advance, ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] NotImplemented error creating WCF ServiceHost
Exactly, the exception is thrown from WCF itself. And that exception tells you that you cannot use the feature unless someone implements it. Though it would be almost impossible to find out which configuration part causes the exception unless you are very familiar with configuration settings or you give up using configuration. It is also likely you are using unsupported feature anyways. Atsushi Eno (2010/11/17 2:23), BrianDonegan wrote: I am converting our current Windows WCF web service to mono. When I try to instantiate our ServiceHost object... ServiceHost selfHost = new ServiceHost(typeof([WebServiceClass]); I get a not implemented error. I figured this is due to something in the existing web service that is not implemented (reasonable). Because I can not find anything in there, I created a new class with no methods, and tried to use it in place of our web service... same error. From this it seems that the error is coming from the ServiceHost ctor itself. Am I missing a compiler key of some sort? I am working with monoTools for Visual Studio to build/debug. Here is the text of the error (sorry for the length): == Unhandled Exception: System.NotImplementedException: The requested feature is no t implemented. at System.Configuration.ConfigurationElement.get_EvaluationContext () [0x0 ] infilename unknown:0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].System.ServiceModel.Configuration.IConfigurationC ontextProviderInternal.GetEvaluationContext () [0x0] infilename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.GetEvaluationContext (IConfigurationContextProviderInternal provider) [0x0] infilename unknown :0 at System.ServiceModel.Configuration.EvaluationContextHelper.GetOriginalContex t (IConfigurationContextProviderInternal owner) [0x0] infilename unknown: 0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].System.ServiceModel.Configuration.IConfigurationC ontextProviderInternal.GetOriginalEvaluationContext () [0x0] in filename un known:0 at System.ServiceModel.Configuration.ConfigurationHelpers.GetOriginalEvaluatio nContext (IConfigurationContextProviderInternal provider) [0x0] in filename unknown:0 at System.ServiceModel.Configuration.EvaluationContextHelper.OnReset (System.C onfiguration.ConfigurationElement parent) [0x0] infilename unknown:0 at System.ServiceModel.Configuration.ServiceModelExtensionCollectionElement`1[ TServiceModelExtensionElement].Reset (System.Configuration.ConfigurationElement parentElement) [0x0] infilename unknown:0 at System.Configuration.PropertyInformation.Reset (System.Configuration.Proper tyInformation parentProperty) [0x0] infilename unknown:0 at System.Configuration.ElementInformation.Reset (System.Configuration.Element Information parentInfo) [0x0] infilename unknown:0 at System.Configuration.ConfigurationElement.Reset (System.Configuration.Confi gurationElement parentElement) [0x0] infilename unknown:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] infilename unkno wn:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] infilename unkno wn:0 at System.Configuration.Configuration.GetSectionInstance (System.Configuration .SectionInfo config, Boolean createDefaultInstance) [0x0] infilename unkno wn:0 at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x0] infilename unknown:0 at System.Configuration.Configuration.GetSection (System.String path) [0x0 ] infilename unknown:0 at System.Configuration.ClientConfigurationSystem.System.Configuration.Interna l.IInternalConfigSystem.GetSection (System.String configKey) [0x0] in filen ame unknown:0 at System.Configuration.ConfigurationManager.GetSection (System.String section Name) [0x0] infilename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSectionFrom ConfigurationManager (System.String sectionPath) [0x0] infilename unknown :0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedS ection (System.Configuration.ContextInformation evalContext, System.String secti onPath) [0x0] infilename unknown:0 at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSection (Sy stem.String sectionPath) [0x0] infilename unknown:0 at System.ServiceModel.Configuration.CommonBehaviorsSection.UnsafeGetSection ( ) [0x0] infilename unknown:0 at System.ServiceModel.Description.ConfigLoader.LookupCommonBehaviors
Re: [Mono-list] How can I copy one drawable into another?
Whoops, I guess that was an extension method I wrote: public static void DrawPixbuf (this Context g, Gdk.Pixbuf pixbuf, Point dest) { g.Save (); Gdk.CairoHelper.SetSourcePixbuf (g, pixbuf, dest.X, dest.Y); g.Paint (); g.Restore (); } Jonathan On 11/16/2010 5:09 PM, Francisco M. Marzoa wrote: Hello, Hmmm... My Cairo.Context seems to not have a DrawPixbuf function :-/ Regards, El 16/11/10 21:43, Jonathan Pobst escribió: Once you have it in a PixBuf, just paint it onto your ImageSurface: using (Cairo.Context g = new Cairo.Context (mySurface)) { g.DrawPixbuf (mypixbuf, new Cairo.Point (0, 0)); } Jonathan ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] NotImplemented error creating WCF ServiceHost
So, you are saying that ServiceHost is not implimented? ServiceHost selfHost = new ServiceHost(typeof([WebServiceClass]); I see lots of examples using it, yet even when passing an empty class as an argument it throws. -- View this message in context: http://mono.1490590.n4.nabble.com/NotImplemented-error-creating-WCF-ServiceHost-tp3045291p3046009.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list