[Mono-winforms-list] Simple tutorial

daniele_dll d.albano at gmail.com
Sun Feb 4 13:34:50 EST 2007


can be that he is trying to pass parameter to another running form

If it's true there are a lot of systems to do it!

First of all, the simpler, is to use static methods/properties, but pay
attention to the executing thread.

Another is using PreFilterMessages method with IMessageFilter interface
passing messages to the application and checking the message code, but i
don't know if is possible to do this in mono because you need to send
messages to the application and this, on windows, can be done throght apis.

Another yet possibility is to "simulate" a message queue so you can
implement a class that must be extended by the form and it will have an own
message queues so when you need to send a message to another form you can
simply do something like Messages.SendTo(FormName/FormObject, Object) and
the dispatcher will deliver the message to the correct form that in the UI
thread, to avoid thread problems, will raise the event and pass the message.

2007/2/4, Rafael Teixeira <monoman at gmail.com>:
>
> Hi Paul,
>
> Well I can't understand your question, as namespaces don't talk. :)
>
> Namespaces just separate logically groups of classes. When you are
> using classes from a namespace, either by having fully qualified
> references or with the short form by means of the using clause, you
> need to:
>
> 1) guarantee there's no collisions on symbols (names)
> 2) you reference all the assemblies where the implementation for the
> needed classes reside (see that the relationships between namespaces
> and assemblies is of the  many-to-many kind).
>
> Example for (1):
>
> using System;
> namespace My.System {
>   class Console {
>     public void DoSomething(string message) {
>         Console.WriteLine(message); // <<< problem here method not found
>            // as it will assume you are referencing My.System.Console
>            // you need to fully qualify as below
>         System.Console.WriteLine(message);
>     }
>   }
> }
>
> Example for (2)
>
> using System.Windows.Forms;
> using System.Collections.Generic;
>
> namespace whatever {
>
>   class MyForm : Form {
>
> ...
>     System.Xml.XmlReader xr = new ...
> }
> }
>
> you need to reference System.dll (where the classes for
> System.Collections reside), System.Xml.dll and
> System.Windows.Forms.dll;
>
> Hope it helps
>
> On 2/4/07, Paul <paul at all-the-johnsons.co.uk> wrote:
> > Hi,
> >
> > Does anyone know of a good, but short and easy to understand app which
> > contains multiple namespaces and forms?
> >
> > I'm having a hell of a time with an app I'm developing which contains
> > multiple forms and two namespaces and I can't get them to talk to each
> > other properly. I've tried a pile of things, but nothing is going.
> >
> > TTFN
> >
> > Paul
> > --
> > "Mmmmmmmm....Shakira geschmiert mit schokolade" sagt Homer
> >
> >
> > _______________________________________________
> > Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> >
> >
> >
> >
>
>
> --
> Rafael "Monoman" Teixeira
> ---------------------------------------
> "The reasonable man adapts himself to the world; the unreasonable one
> persists in trying to adapt the world to himself. Therefore all
> progress depends on the unreasonable man." George Bernard Shaw
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>



-- 
Sviluppo di applicativi, web e non, basati su PHP e/o C#. Configurazione,
installazione e amministrazioni sistemi Linux e Windows.

http://www.phpsoft.it - http://blog.phpsoft.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20070204/cc14962d/attachment.html 


More information about the Mono-winforms-list mailing list