Click here to Skip to main content
15,891,749 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sql query for like statement Pin
J4amieC8-May-09 1:28
J4amieC8-May-09 1:28 
Question[Message Deleted] Pin
nagendra.vk8-May-09 0:05
nagendra.vk8-May-09 0:05 
AnswerRe: Trail Version [modified] Pin
harold aptroot8-May-09 0:34
harold aptroot8-May-09 0:34 
GeneralRe: Trail Version Pin
nagendra.vk8-May-09 0:56
nagendra.vk8-May-09 0:56 
GeneralRe: Trail Version Pin
Mycroft Holmes8-May-09 1:26
professionalMycroft Holmes8-May-09 1:26 
AnswerRe: Trail Version Pin
Alex@UEA8-May-09 2:49
Alex@UEA8-May-09 2:49 
Questionhow to find latest table created from database. Pin
KIDYA8-May-09 0:01
KIDYA8-May-09 0:01 
AnswerRe: how to find latest table created from database. Pin
Noctris8-May-09 0:06
Noctris8-May-09 0:06 
AnswerRe: how to find latest table created from database. Pin
Mycroft Holmes8-May-09 1:29
professionalMycroft Holmes8-May-09 1:29 
AnswerRe: how to find latest table created from database. Pin
J4amieC8-May-09 1:30
J4amieC8-May-09 1:30 
AnswerRe: how to find latest table created from database. Pin
Rajesh Anuhya8-May-09 3:16
professionalRajesh Anuhya8-May-09 3:16 
Question[Message Deleted] Pin
Mads1157-May-09 23:36
Mads1157-May-09 23:36 
AnswerRe: how to add button click events(C#.net) to database(SQL2005) Pin
Noctris8-May-09 0:00
Noctris8-May-09 0:00 
AnswerRe: how to add button click events(C#.net) to database(SQL2005) Pin
WinSolution8-May-09 1:08
WinSolution8-May-09 1:08 
AnswerRe: how to add button click events(C#.net) to database(SQL2005) Pin
musefan8-May-09 2:21
musefan8-May-09 2:21 
Questioninserting Hyperlink inside windows form Pin
shabya7-May-09 23:23
shabya7-May-09 23:23 
AnswerRe: inserting Hyperlink inside windows form Pin
OriginalGriff7-May-09 23:31
mveOriginalGriff7-May-09 23:31 
GeneralRe: inserting Hyperlink inside windows form Pin
shabya8-May-09 1:26
shabya8-May-09 1:26 
AnswerRe: inserting Hyperlink inside windows form Pin
MickCurley8-May-09 0:00
MickCurley8-May-09 0:00 
GeneralRe: inserting Hyperlink inside windows form Pin
shabya8-May-09 1:28
shabya8-May-09 1:28 
AnswerRe: inserting Hyperlink inside windows form Pin
MumbleB8-May-09 0:48
MumbleB8-May-09 0:48 
GeneralRe: inserting Hyperlink inside windows form Pin
shabya8-May-09 1:26
shabya8-May-09 1:26 
QuestionGlobal ( sort of) event ? Pin
Noctris7-May-09 23:19
Noctris7-May-09 23:19 
Hi,

I have a class library, which actuall is a little application itself. It does communication with our server, starts a download queue and autodownloader and does some background processing.


This to provide data and files for the different host app's that are using this class library ( see it as a communications client)

now in the library, i have some events that need to be received by the host app like for example:

FileCountChanged. the problems is, this can be triggered from The AutoDownloader because it finished a download, from the TCP Client cause the server told him to delete a file etc etc..

Now my question is: is there a way to raise a global event from different classes ?

The more or less same question applies to variables ( objects). Can i change the variable of my main class from its sub classes ?

Something like for example:






<br />
<br />
public delegate void FileCountChangedEventHandler(FileType filetype,int count);<br />
public class MyClient<br />
{<br />
<br />
// Should be raised if:<br />
// File get's deleted, File is added, <br />
// This can be initiated from many different classes...<br />
// How do <br />
public event FilecountChanged(FileType filetype,int count);<br />
private DownloadQueue _dlqueue = new _dlqueue();<br />
<br />
// I should be able to add and remove downloads in this queue from anywhere HOWEVER.. it must be this queue. Do i have to pass this to <br />
// all the classes that need to use it ? And do i use ref or just normal ?<br />
private AutoDownloader dl = null;<br />
public Myclient()<br />
{<br />
dl = new AutoDownloader(_dlqueue);<br />
dl.start();<br />
dl.DownloadCompleted += new eventhandler(ondownloadcompleted);<br />
}<br />
<br />
<br />
<br />
}<br />
<br />


Thanks !

Do Or Don't, there is no "try catch ex as exception end try"

AnswerRe: Global ( sort of) event ? Pin
Jimmanuel8-May-09 1:08
Jimmanuel8-May-09 1:08 
GeneralRe: Global ( sort of) event ? Pin
Noctris9-May-09 8:10
Noctris9-May-09 8:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.