| | |
The name 'srvr' does not exist in the current context
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
If you're not into the singleton thing, you need to think of the separation between the display and server.
Look at using events,
example when server is started, you catch the event in the notify icon and update the display properly, without having the server ever know about what is displaying in the ui portion.
Look at using events,
example when server is started, you catch the event in the notify icon and update the display properly, without having the server ever know about what is displaying in the ui portion.
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Sep 2007
Posts: 56
Reputation:
Solved Threads: 0
C# Syntax (Toggle Plain Text)
If you're not into the singleton thing, you need to think of the separation between the display and server.
And I'm not sure how to do it using events.
•
•
Join Date: Sep 2007
Posts: 56
Reputation:
Solved Threads: 0
•
•
•
•
Look at using events,
example when server is started, you catch the event in the notify icon and update the display properly, without having the server ever know about what is displaying in the ui portion.
•
•
Join Date: Aug 2008
Posts: 1,162
Reputation:
Solved Threads: 138
Here is one on Microsoft, a little technicalhttp://msdn.microsoft.com/en-us/library/aa645739(VS.71).aspx
Here is a little less technical and probably easier to follow
http://www.csharphelp.com/archives/archive253.html
Once you read them,
create the event in the server class, such OnServerStarted
in the notify class, create a server private variable and subscribe to each event
then on each event that is received, you can update your text as the event is received
Here is a little less technical and probably easier to follow
http://www.csharphelp.com/archives/archive253.html
Once you read them,
create the event in the server class, such OnServerStarted
in the notify class, create a server private variable and subscribe to each event
then on each event that is received, you can update your text as the event is received
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
•
•
Join Date: Nov 2005
Posts: 33
Reputation:
Solved Threads: 5
•
•
•
•
If you pass server to it, any other class that uses this notify icon will require to instantiate it with server, when possibly they might not have anything to do with server.
I'm sorry but i still can't see , looking at the code so far, why it will not work
. so let's say you have this in main() Server srvr= new Server();
Notify_Icon ico=new Notify_Icon();
srvr.Start(ico);
// do something..
srvr.Stop(ico);
and in other functions you will have :
srvr.Start();
// do something..
srvr.Stop();
now... if this will not work .... then i'm missing the whole point so sorry
. Last edited by miculnegru; Aug 28th, 2008 at 3:07 am.
•
•
Join Date: Sep 2007
Posts: 56
Reputation:
Solved Threads: 0
•
•
•
•
Ok, so why not create overload methods, one for srvr.Start() and one for srvr.Stop() ?
I'm sorry but i still can't see , looking at the code so far, why it will not work. so let's say you have this in main()
Server srvr= new Server();
Notify_Icon ico=new Notify_Icon();
srvr.Start(ico);
// do something..
srvr.Stop(ico);
and in other functions you will have :
srvr.Start();
// do something..
srvr.Stop();
now... if this will not work .... then i'm missing the whole point so sorry.
oh well at least it works
. Thanks anyway. ![]() |
Other Threads in the C# Forum
- Previous Thread: How to know the number of columns in the table
- Next Thread: how to insert data...
Views: 6385 | Replies: 17
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box button buttons c# chat check checkbox class client code color combobox control conversion csharp custom database datagridview dataset datetime degrees draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






