[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Event problems when passing values with properties

Cyr1dian

11/4/2004 9:36:00 PM

Hi guys,

Here's the thing: I have a pretty basic setup with 2 clients and a server
using a singleton to communicate. Pretty basic communication is achieved by
setting a value in a property of the sharedobject and then retrieving it.
example:

Cube.name="Fred";

Setting the name in client 1 and then reading it in client 2 works fine,
very basic. Now I wanted to expand this by firing an event (manually, by
pressing an Apply button) when I had edited the name and all the clients
would then update automatically.

The thing that goes wrong: It won't work unless you pass the name along with
the event instead of with the property. Anyone know what the deal with that
is!? Because I want to build something where I can freely set properties of
an object and when I'm done notify everyone else that theyve been set by way
of an event without taht event necessarily having to contain any data.

thanks in advance!


2 Answers

Ken Kolda

11/4/2004 10:21:00 PM

0

What do you mean by "it won't work"? You should certainly be able to set the
property, fire the event and have your other clients see the change that was
made to it assuming everything's working correctly. Are you saying that in
your clients' event handler that you see the old value when you fetch the
Cube.name property?

You may want to post some sample code -- just be sure to pare it down as far
as possible. Also, the best thing to do is post an entire VS.NET solution in
a ZIP file instead of some code fragments.

Ken


"Cyr1dian" <Abuse@FBI.com> wrote in message
news:%237mVkYrwEHA.3096@TK2MSFTNGP14.phx.gbl...
> Hi guys,
>
> Here's the thing: I have a pretty basic setup with 2 clients and a server
> using a singleton to communicate. Pretty basic communication is achieved
by
> setting a value in a property of the sharedobject and then retrieving it.
> example:
>
> Cube.name="Fred";
>
> Setting the name in client 1 and then reading it in client 2 works fine,
> very basic. Now I wanted to expand this by firing an event (manually, by
> pressing an Apply button) when I had edited the name and all the clients
> would then update automatically.
>
> The thing that goes wrong: It won't work unless you pass the name along
with
> the event instead of with the property. Anyone know what the deal with
that
> is!? Because I want to build something where I can freely set properties
of
> an object and when I'm done notify everyone else that theyve been set by
way
> of an event without taht event necessarily having to contain any data.
>
> thanks in advance!
>
>


Cyr1dian

11/5/2004 10:02:00 AM

0

It runs, the events fire, but it hangs every time; The other client(s) never
update(s). No error message what-so-ever, the program just crashes. I'll see
about rebuilding the original problem to post here.

What you say is exactly what I expected to see... but it's its not what I'm
getting, that's the whole problem ;)