|
I think any msdn article on event handlers should help you out. But from the code it looks like you are trying to assign the event itself as the handler. Normally you would write a method which has the same signture as your delegate. That method will be your event handler. Something like
public delegate void GNISImportFileEventHandler(object sender, ImportFileEventArgs e);<br />
public event GNISImportFileEventHandler OnImportFile;<br />
<br />
public void myGNISImportFileEventHandler(object sender, ImportFileEventArgs e)<br />
{<br />
}
And you would add the handler like:
myObj.OnImportFile += new GNISImportFileEventHandler(myGNISImportFileEventHandler);
modified: added "myObj." Assuming myObj is the object of your ImportFile class. It could be this. if you are adding it to the same object (which is really not needed since you can just call the method directly..
|
|
|
|
|
Thank you very much for your reply I can now use my event, I understand where I went wrong - I can't use the event as the handler. Thank you very much. One more question for you, How would I use this on a form outside of the class(in a different project) but in the same solution.
|
|
|
|
|
Just add a reference to this project from the other project. (right click on project- add reference..)
|
|
|
|
|
Hi,
I am using TreeView control in C# form application.
This contains no. of nodes and their child node. I want to traverse entire tree view and edit some properties dynamically.
What is the method in C# to traverse TreeView?
Thanks.
Gajesh
|
|
|
|
|
You will have to write a recursive function to traverse all the nodes in a tree view.
|
|
|
|
|
Hi all
i got an html table in an aspx page and i need to parse data from each td and save to database. Any ideas!!!!
|
|
|
|
|
Repost
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
If you are asking how to get the text out of the TD, then use the innertext property of the TD. Make the TD "runat=server" and give it an ID.
|
|
|
|
|
There are many data access layer tools , so I do not know where to start . I just want to get out of repetitive boiler plate coding . But I have a few requirments:-
1) Works with MsSQL . ( Virtually all should)
2) Produce C# code (Again - all should)
3) Must produce a data object that maps onto a row of a table .( This has been the stumbling block)
4) The data object must have no references to any DB/connection . I.e pure data . Maybe a few Ctors , ideally a struct , but if a class must support ICloneable .
5) Icing on the cake is if the data object overrides = in order to make a value comparison ( I know MS advise against it but its useful).
6) Collections of the data objects would be nice
Why the 1:1 row to object ? Well I found over the years that if I put all my effort into a normalised DB then the code almost falls into place if I produce a 1:1 row - > object . Then I use an object that maps to a table or stored procs in order to communicate with the underlying tables . Not haveing any reference to the DB in the data object means it is as light as possible in the GUI
|
|
|
|
|
|
Guten Tag,
If I have an excel Worksheet instance say sheet1 and a DataTable instance dt1, how do I add a row to the sheet1 row by row instead
of iterating to each row and iterating to each cell within that row in the dt1? I want to be able to do this because it seems it would be faster as such. 5K rows of 20 columns each takes about 12 minutes saving to an excel file in my machine using the latter method.
Thanks for any guidance.
-- modified at 9:37 Wednesday 9th May, 2007
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
i have a problem to record the desktop as Avi or Mpeg file How can i record the desktop
any Idea or source ?
With thanks
MHF
|
|
|
|
|
|
I think you should use some screen recorder, which can help you capture whatever streaming video and audio files on your screen, and it can help you record full screen. If you want to get the video to standard video format, it also can help you capture video to avi, so that you can export it to your portable device or upload to some video sharing website.
|
|
|
|
|
HI!
i am generating a license key for my software. i am using System.Security.Cryptography.TrippleDES encryption technique.
i am generating a 25-digit random number and a 25-bit string which represents the features of application.
First i am interlacing both strings and then encrypting them using TrippleDES algo. But the encrypted string which is returned by the function Encrypt(), i.e. also my license key is more than 150 characters long, which is ofcourse too long for a license key.
Can any one give me idea how can i generate a shorter license key, about 25-30 characters long...should i change the encryption algo or do something else...?
Thanks in advance..
Regards,
Affan Ahmad Toor
.....................................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: First i am interlacing both strings and then encrypting them using TrippleDES algo. But the encrypted string which is returned by the function Encrypt(), i.e. also my license key is more than 150 characters long, which is ofcourse too long for a license key.
You can store the key in a file and which can be read by your program, it could be a flat file or an xml file. I have seen a few companies use this technique to send long encrypted licenses.
|
|
|
|
|
Hi!
thanks for reply...
i think you did'nt got my point, my problem is not that i dont know how or where to store such long license key, infact i want my license key to be as short as 25-30 characters...
Do you know any way to do it?
Thanks in advance...
Regards,
Affan Ahmad Toor
.....................................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Hi everyone!
I am searching for a tag cloud control. Is there something compareable available as source, or would I have to do this completely on my own?
So far I only found source that generates HTML, but I would like to use such a cloud on a form, so I prefer GDI+ drawing instead of markup output.
I tried on my own a little bit, but it looks kind of ugly - depending on the tags it shows. Animating it in sense of slowly changing the single priorities flickers and leads to line-jumps in my implementation, argh.
I have not found the perfect algorithm to arrange tags always on the same place so it looks good even when they reach maximum or minimum size. And public available algorithms always focus on markup output instead of sizes or areas where I could draw my tags in.
Hints are welcome, example implementations would even be loved.
Roland
|
|
|
|
|
Mkay... completely no answers. What a pity, so I will stick on the ugly ones I made myself. :-p
If I should find some additional time and it results in a super tag cloud for C# I will let you know.
Roland
|
|
|
|
|
I am working on a IM client,I want a rich text box which supports fonts and emoticons for my chat window,Somebody please suggest me a third party control for .NET windows application(free or purchased both will do) which can solve my problem or else suggest me a way to do it programatically in .NET windows application
Zeeshan
|
|
|
|
|
using browser control is fairly decent idea
|
|
|
|
|
Sorry for bothering you all. I'm quite busy at work, but has to submit synopsis for my post graduate project. Kindly suggest some topic for the project. Please topic only, rest of the work I will do myself.
Thanks in advance.
Aman Tur
modified 9-Jul-22 21:01pm.
|
|
|
|
|
I'm not sure.. try "Posting in the right place", "Asking clear questions", you know.. there's a lot you can think of
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi everybody,
i m sending value to the database from child form. In the parent form i have a listbox which is
displaying the values retrieved from database.
my problem is that when i m sending values to the database from child from updation is not shown in parent form's listbox while database is already updated. send some clue or possible send some c# code.
|
|
|
|
|
you may have to clear the bindings of the listbox and re-bind data.
|
|
|
|