Click here to Skip to main content
15,909,193 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to use event to re-write this code segment? Pin
George_George5-Jun-08 14:51
George_George5-Jun-08 14:51 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 17:49
mvePIEBALDconsult1-Jun-08 17:49 
GeneralRe: how to use event to re-write this code segment? Pin
George_George1-Jun-08 18:34
George_George1-Jun-08 18:34 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 19:12
mvePIEBALDconsult1-Jun-08 19:12 
GeneralRe: how to use event to re-write this code segment? Pin
George_George1-Jun-08 19:17
George_George1-Jun-08 19:17 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult1-Jun-08 19:26
mvePIEBALDconsult1-Jun-08 19:26 
GeneralRe: how to use event to re-write this code segment? Pin
George_George2-Jun-08 0:52
George_George2-Jun-08 0:52 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult2-Jun-08 9:07
mvePIEBALDconsult2-Jun-08 9:07 
Here's a simple console program that will display the time every five seconds until you press RETURN.

namespace Template
{
    public partial class Template
    {
        private System.Timers.Timer tt = null ;
 
        public Template
        (
            int Interval
        )
        {
            tt = new System.Timers.Timer ( Interval ) ;
 
            tt.Elapsed += F ;
 
            return ;
        }
 
        private void
        F
        (
            object                         sender
        ,
            System.Timers.ElapsedEventArgs e
        )
        {
            System.Console.WriteLine ( System.DateTime.Now.ToString() ) ;
 
            // Do other stuff
 
            return ;
        }
 
        public void
        Start
        (
        )
        {
            tt.Start() ;
 
            return ;
        }
 
        public void
        Stop
        (
        )
        {
            tt.Stop() ;
 
            return ;
        }
 
        [System.STAThreadAttribute()]
        public static int
        Main
        (
            string[] args
        )
        {
            int result = 0 ;
 
            try
            {
                Template x = new Template ( 5000 ) ;
 
                x.Start() ;
 
                System.Console.ReadLine() ;
 
                x.Stop() ;
            }
            catch ( System.Exception err )
            {
                while ( err != null )
                {
                    System.Console.WriteLine ( err.Message ) ;
 
                    err = err.InnerException ;
                }
            }
 
            return ( result ) ;
        }
    }
}

GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 1:36
George_George3-Jun-08 1:36 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult3-Jun-08 17:59
mvePIEBALDconsult3-Jun-08 17:59 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 18:27
George_George3-Jun-08 18:27 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult3-Jun-08 18:49
mvePIEBALDconsult3-Jun-08 18:49 
GeneralRe: how to use event to re-write this code segment? Pin
George_George3-Jun-08 19:00
George_George3-Jun-08 19:00 
GeneralRe: how to use event to re-write this code segment? Pin
PIEBALDconsult3-Jun-08 19:03
mvePIEBALDconsult3-Jun-08 19:03 
QuestionHow can I create own Browser? Pin
lockepeak1-Jun-08 14:08
lockepeak1-Jun-08 14:08 
AnswerRe: How can I create own Browser? Pin
Christian Graus1-Jun-08 15:54
protectorChristian Graus1-Jun-08 15:54 
QuestionReading Registry Key Problem. Pin
Jammer1-Jun-08 13:56
Jammer1-Jun-08 13:56 
AnswerRe: Reading Registry Key Problem. Pin
Sujith C Jose2-Jun-08 2:58
Sujith C Jose2-Jun-08 2:58 
QuestionCan I find out how many dataset are in a project? Pin
belzer1-Jun-08 11:20
belzer1-Jun-08 11:20 
AnswerRe: Can I find out how many dataset are in a project? Pin
Christian Graus1-Jun-08 15:54
protectorChristian Graus1-Jun-08 15:54 
GeneralRe: Can I find out how many dataset are in a project? Pin
belzer2-Jun-08 4:21
belzer2-Jun-08 4:21 
QuestionCan we declare method with optional parameters ? Pin
Mohammad Dayyan1-Jun-08 9:43
Mohammad Dayyan1-Jun-08 9:43 
AnswerRe: Can we declare method with optional parameters ? Pin
Giorgi Dalakishvili1-Jun-08 9:53
mentorGiorgi Dalakishvili1-Jun-08 9:53 
AnswerRe: Can we declare method with optional parameters ? Pin
Scott Dorman1-Jun-08 17:05
professionalScott Dorman1-Jun-08 17:05 
AnswerRe: Can we declare method with optional parameters ? Pin
Jaime Olivares1-Jun-08 19:21
Jaime Olivares1-Jun-08 19:21 

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.