Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
NewsSQLite wrapper class Pin
Igor Sokolsky27-Aug-07 8:22
Igor Sokolsky27-Aug-07 8:22 
QuestionExpose EventHandler to VBScript [modified] Pin
patrickcbrown27-Aug-07 5:53
patrickcbrown27-Aug-07 5:53 
Hello

Does anyone have an example of how to expose a C# EventHandler so that VBScript can hook up to it? It must be VBScript. I can call methods on this very basic class, but can't get the event hooked up. This is a Class Library and is built with the "Register for COM Interop" switch set.

<br />
    public class Talker<br />
    {<br />
        public event EventHandler SomeNeatEvent;<br />
        private System.Timers.Timer EventTicker = new System.Timers.Timer();<br />
<br />
        public Talker()<br />
        {<br />
            EventTicker.Interval = 2000;<br />
            EventTicker.AutoReset = true;<br />
            EventTicker.Enabled = false;<br />
            EventTicker.Elapsed += new System.Timers.ElapsedEventHandler(EventTicker_Elapsed);<br />
        }<br />
<br />
        void EventTicker_Elapsed(object sender, System.Timers.ElapsedEventArgs e)<br />
        {<br />
            if (SomeNeatEvent != null)<br />
            {<br />
                SomeNeatEvent(this, new EventArgs());<br />
            }<br />
        }<br />
<br />
        public void ToggleTickerEnabled()<br />
        {<br />
            EventTicker.Enabled = !EventTicker.Enabled;<br />
        }<br />
    }<br />


Thank you for your time and ideas
Patrick

-- modified at 13:20 Monday 27th August, 2007
QuestionNewbie question about "%" Pin
...---...27-Aug-07 5:34
...---...27-Aug-07 5:34 
AnswerRe: Newbie question about "%" Pin
Michael Potter27-Aug-07 5:47
Michael Potter27-Aug-07 5:47 
Questiontrying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap Pin
aei_totten27-Aug-07 4:58
aei_totten27-Aug-07 4:58 
AnswerRe: trying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap Pin
aei_totten27-Aug-07 5:14
aei_totten27-Aug-07 5:14 
Questionhow can i shut down my LAN? any idea Pin
nayabsiddiqi27-Aug-07 4:27
nayabsiddiqi27-Aug-07 4:27 
AnswerRe: how can i shut down my LAN? any idea Pin
Le centriste27-Aug-07 5:01
Le centriste27-Aug-07 5:01 
GeneralRe: how can i shut down my LAN? any idea Pin
nayabsiddiqi27-Aug-07 5:35
nayabsiddiqi27-Aug-07 5:35 
AnswerRe: how can i shut down my LAN? any idea Pin
Spacix One27-Aug-07 7:06
Spacix One27-Aug-07 7:06 
GeneralRe: how can i shut down my LAN? any idea Pin
nayabsiddiqi2-Oct-07 6:46
nayabsiddiqi2-Oct-07 6:46 
QuestionFieldBuilder question Pin
ma7moud_7elmy27-Aug-07 4:12
ma7moud_7elmy27-Aug-07 4:12 
QuestionData Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 2:38
vs2428427-Aug-07 2:38 
AnswerRe: Data Transfer from .Net to VB6 application Pin
Leyu27-Aug-07 4:31
Leyu27-Aug-07 4:31 
GeneralRe: Data Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 23:16
vs2428427-Aug-07 23:16 
AnswerRe: Data Transfer from .Net to VB6 application Pin
Justin Perez27-Aug-07 4:44
Justin Perez27-Aug-07 4:44 
GeneralRe: Data Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 23:16
vs2428427-Aug-07 23:16 
Questionstart external app, but in a sync way Pin
blackjack215027-Aug-07 2:05
blackjack215027-Aug-07 2:05 
AnswerRe: start external app, but in a sync way Pin
Justin Perez27-Aug-07 2:13
Justin Perez27-Aug-07 2:13 
GeneralRe: start external app, but in a sync way Pin
blackjack215027-Aug-07 2:19
blackjack215027-Aug-07 2:19 
GeneralRe: start external app, but in a sync way Pin
Martin#27-Aug-07 2:32
Martin#27-Aug-07 2:32 
GeneralRe: start external app, but in a sync way Pin
Justin Perez27-Aug-07 2:39
Justin Perez27-Aug-07 2:39 
AnswerRe: start external app, but in a sync way Pin
Spacix One28-Aug-07 10:19
Spacix One28-Aug-07 10:19 
Questioninserting data into a label Pin
lourensG27-Aug-07 1:10
lourensG27-Aug-07 1:10 
AnswerRe: inserting data into a label Pin
Christian Graus27-Aug-07 1:34
protectorChristian Graus27-Aug-07 1:34 

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.