Inheritance: System.Windows.Threading.DispatcherTimer
Esempio n. 1
1
        public void UpdateHeartbeat()
        {
            // Create or Update External XML For Last Update Check DateTime
            if (!File.Exists(CheckUpdateFile))
            {
                DateTime DateTimeNow = DateTime.Now;
                XmlWriterSettings wSettings = new XmlWriterSettings();
                wSettings.Indent = true;
                XmlWriter writer = XmlWriter.Create(CheckUpdateFile, wSettings);
                writer.WriteStartDocument();
                writer.WriteComment("This file is generated by WWIV5TelnetServer - DO NOT MODIFY.");
                writer.WriteStartElement("WWIV5UpdateStamp");
                writer.WriteStartElement("LastChecked");
                writer.WriteElementString("DateTime", DateTimeNow.ToString());
                writer.WriteEndElement();
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Flush();
                writer.Close();
            }

            // Do Update Check
            updateTimer = new System.Timers.Timer(1000 * 60 * 60); // Hourly - Release Code
            //updateTimer = new System.Timers.Timer(1000 * 10); // 10 Seconds for Testing Only
            updateTimer.Elapsed += new ElapsedEventHandler(DoUpdateCheck);
            updateTimer.AutoReset = true;
            updateTimer.Enabled = true;
            if (Properties.Settings.Default.checkUpdates == "On Startup")
            {
                DoUpdateCheck(null, null);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Start timer function
 /// </summary>
 private void StartTimer()
 {
     timer = new Timer(TimerInterval);
     timer.Elapsed += new ElapsedEventHandler(TimerEvent);
     timer.AutoReset = true;
     timer.Enabled = true;
 }
Esempio n. 3
0
 protected override void InitializeImpl()
 {
     this._timers = this.TimerJobs
         .Where(j => j.Item1 > 0.0)
         .OrderBy(j => j.Item1)
         .Select(j =>
         {
             Timer timer = new Timer(j.Item1);
             timer.Elapsed += (sender, e) =>
             {
                 timer.Stop();
                 try
                 {
                     this.Host.RequestManager.Execute<Object>(Request.Parse(j.Item2));
                 }
                 finally
                 {
                     timer.Start();
                 }
             };
             return timer;
         }).ToList();
     this.RunInitializingJobs();
     base.InitializeImpl();
 }
Esempio n. 4
0
 public HomeViewModel()
 {
     timer = new Timer(1000);
     timer.Elapsed += TimerElapsed;
     timer.AutoReset = true;
     timer.Start();
 }
 public SamplingTargetPointGenerator(int samplesPerSecond)
 {
     workerTimer = new Timer(1000 / samplesPerSecond);
     workerTimer.Elapsed += this.WorkerTimerElapsed;
     workerTimer.AutoReset = false;
     workerTimer.Start();
 }
Esempio n. 6
0
 public Server()
 {
     config = new INIReader(System.IO.File.ReadAllLines("config.ini"));
     chat = new ServerChat();
     instance = this;
     vehicleController = new ServerVehicleController();
     api = new ServerApi(this);
     gamemodeManager = new GamemodeManager(api);
     gamemodeManager.loadFromFile("gamemodes/" + config.getString("gamemode"));
     server = new TcpListener(IPAddress.Any, config.getInt("game_port"));
     server.Start();
     server.BeginAcceptTcpClient(onIncomingConnection, null);
     playerpool = new List<ServerPlayer>();
     Timer timer = new Timer();
     timer.Elapsed += onBroadcastTimer;
     timer.Interval = config.getInt("broadcast_interval");
     timer.Enabled = true;
     timer.Start();
     UDPStartPort = config.getInt("udp_start_port");
     Timer timer_slow = new Timer();
     timer_slow.Elapsed += timer_slow_Elapsed;
     timer_slow.Interval = config.getInt("slow_interval");
     timer_slow.Enabled = true;
     timer_slow.Start();
     http_server = new HTTPServer();
     Console.WriteLine("Started game server on port " + config.getInt("game_port").ToString());
     Console.WriteLine("Started http server on port " + config.getInt("http_port").ToString());
 }
Esempio n. 7
0
		protected override void Run ()
		{
			if (!Taskbar.TaskbarManager.IsPlatformSupported) {
				return;
			}
			
			bool areFileExtensionsRegistered = this.Initialize ();
			
			if (!areFileExtensionsRegistered) {
				return;
			}
			
			this.updateTimer = new Timer (1000);
			this.updateTimer.Elapsed += this.OnUpdateTimerEllapsed;
			this.updateTimer.AutoReset = false;
			
			this.recentFiles = DesktopService.RecentFiles;
			this.recentFiles.Changed += this.OnRecentFilesChanged;

			try {
				UpdateJumpList();
			} catch (Exception ex) {
				MonoDevelop.Core.LoggingService.LogError ("Could not update jumplists", ex);
			}
		}
Esempio n. 8
0
        public ExchangesWindow()
        {
            InitializeComponent();
            DataContext = this;

            Exchanges = new ObservableCollection<Exchange>();

            List<Exchange> tmpExchanges;
            using (var entityContext = new MyDBContext())
            {
                tmpExchanges = entityContext.Exchanges.Include("Sessions").OrderBy(x => x.Name).ToList();
            }
            foreach (Exchange e in tmpExchanges)
            {
                Exchanges.Add(e);
            }

            ExchangesGrid.ItemsSource = Exchanges;

            _filterTimer = new Timer();
            _filterTimer.Enabled = false;
            _filterTimer.AutoReset = false;
            _filterTimer.Interval = 100; //milliseconds
            _filterTimer.Elapsed += _filterTimer_Elapsed;
        }
 /// <summary>
 /// Creates a new Instance of the ServerLog
 /// </summary>
 public ServerLog()
 {
     _buffer = new StringBuilder(4096);
     _writetimer = new Timer();
     _writetimer.Interval = 5000;
     _writetimer.Elapsed += _writetimer_Elapsed;
 }
 public MainWindow()
 {
     InitializeComponent();
     _timer = new Timer(30000);
     _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
     _timer.Enabled = true;
 }
        public Ux2CampaignService()
        {
            InitializeComponent();
            //this.cExcHandler = new GanoExceptionHandling(EXC_URL, cErrorFile);

            LoadSettings();

            if (!EventLog.SourceExists(EVENT_LOG_SOURCE))
                EventLog.CreateEventSource(EVENT_LOG_SOURCE, EVENT_LOG);

            try
            {
                this.cScheduleTimer = new System.Timers.Timer(this.cInterval);
                this.cScheduleTimer.Elapsed += new ElapsedEventHandler(cScheduleTimer_Elapsed);
                this.cScheduleTimer.Enabled = true;

                EventLog.WriteEntry(EVENT_LOG_SOURCE, "Ux2 Campaign Service Started on " + DateTime.Now.ToString() + "\n" +
                    "Settings loaded from " + Path.GetDirectoryName(Application.ExecutablePath) + "\\" + SETTINGS_FILE + "\n" +
                    "Processing Interval: " + this.cInterval + "ms\n" +
                    "Max Campaign Age: " + this.cMaxAge + "hours");

                this.cProcessor = new ScheduleProcessor(this.cConnectionString, cMaxAge);
                this.cProcessorCaller = new CallScheduleProcessor(this.cProcessor.ProcessSchedules);
            }
            catch (Exception exc)
            {
                //this.cExcHandler.LogExceptionQuiet(null, exc);
                EventLog.WriteEntry(EVENT_LOG_SOURCE, exc.Message);
            }
        }
 public Object CreateMainLoopTimer(MainServerLoop mainLoop, uint period)
 {
     myTimer = new Timer(period);
     myTimer.Elapsed += (sender, e) => {mainLoop();};
     myTimer.Enabled = true;
     return myTimer;
 }
Esempio n. 13
0
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            this.txtID.Text = string.Empty;
            this.txtName.Text = string.Empty;
            this.LblResult.Text = string.Empty;

            try
            {
                Init();
                int interval = 20;
                timer = new Timer();
                timer.Interval = interval;
                timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
                timer.AutoReset = true;
                timer.Enabled = true;
                timer.Start();

                this.btnStart.IsEnabled = false;
                this.btnStop.IsEnabled = true;
                this.btnStop.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
Esempio n. 14
0
 /// <summary>Constructs a Rx timer stage</summary>
 /// <param name="observer">the observer</param>
 /// <param name="initialDelay">the initial delay in milli-seconds</param>
 /// <param name="period">the period in milli-seconds</param>
 public RxTimerStage(IObserver<PeriodicEvent> observer, long initialDelay, long period)
 {
     _observer = observer;
     _timer = new Timer(period);
     _timer.Elapsed += (sender, e) => OnTimedEvent(sender, e, _observer, _value);
     _timer.Enabled = true;
 }
Esempio n. 15
0
        /// <summary>
        /// Create an new Instance of the TCP-Listener on Port 5000
        /// </summary>
        internal Server()
        {
            try
            {
                AnrlDB.AnrlDataContext db = new AnrlDB.AnrlDataContext();
                if (!db.DatabaseExists())
                {
                    db.CreateDatabase();
                }

                CalculateTabels = new System.Timers.Timer(20000);
                CalculateTabels.Elapsed += new ElapsedEventHandler(CalculateTabels_Elapsed);
                CalculateTabels.Start();

                running = true;
                this.tcpListener = new TcpListener(IPAddress.Any, 5000);
                this.listenThread = new Thread(new ThreadStart(ListenForClients));
                this.listenThread.Start();
                db.Dispose();
            }
            catch (Exception ex)
            {
                Logger.Log("Exception in Server.Server" + ex.ToString(), 11);
            }
        }
Esempio n. 16
0
 public void DisposeTimer() {
   if (tmTimeout != null) {
     tmTimeout.Enabled = false;
     tmTimeout.Dispose();
     tmTimeout = null;
   }
 }
Esempio n. 17
0
        public Step2(Global g)
        {
            this.Opacity = 0.0f;
            this.g = g;

               // this.BackgroundImage = g.getTheme("bg");
            InitializeComponent();
            initTheme();
            noFocus.Select();

            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 500;
            aTimer.Enabled = true;
            DateTime t1 = DateTime.Now;
            string H = t1.Hour.ToString();
            if (H.Length == 1) H = "0" + H;

            string M = t1.Minute.ToString();
            if (M.Length == 1) M = "0" + M;

            if (t1.Second % 2 == 0)
                SetTime(H + ":" + M);
            else
                SetTime(H + " " + M);

            //pbs.Add("1", pictureBox1);
               // pbs.Add("2", pictureBox2);
               // pbs.Add("3", pictureBox3);
               // pbs.Add("4", pictureBox4);

            loadMENU0();

            g.playVoice("5");
        }
Esempio n. 18
0
 public SweepGenerator(IWorkContextAccessor workContextAccessor) {
     _workContextAccessor = workContextAccessor;
     _timer = new Timer();
     _timer.Elapsed += Elapsed;
     Logger = NullLogger.Instance;
     Interval = TimeSpan.FromMinutes(1);
 }
        public AudioPlayer()
        {
            InitializeComponent();
            timerUpdate = new Timer();

            this.timerUpdate.Interval = 50;
            this.timerUpdate.Elapsed += new ElapsedEventHandler(timerUpdate_Elapsed);
            this.pictureBoxWaveForm.MouseDown += new MouseButtonEventHandler(pictureBoxWaveForm_MouseDown);
            this.wavePosition.MouseDown += new MouseButtonEventHandler(pictureBoxWaveForm_MouseDown);
            
            
            this.wavePosition.Width = 2;
            this.wavePosition.Height = this.pictureBoxWaveForm.Height;
            this.wavePosition.Opacity = 0.5;
            this.wavePosition.Fill = Brushes.Red;

           
            _mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_SAMPLE_FLOAT);
            if (_mixer == 0)
            {
                MessageBox.Show("Could not create mixer!");
                Bass.BASS_Free();
                return;
            }

            _mixerStallSync = new SYNCPROC(OnMixerStall);
            Bass.BASS_ChannelSetSync(_mixer, BASSSync.BASS_SYNC_STALL, 0L, _mixerStallSync, IntPtr.Zero);

            timerUpdate.Start();
            Bass.BASS_ChannelPlay(_mixer, false);


            newtrack(@"D:\OAIBC\2-13 California.mp3", null);

        }
Esempio n. 20
0
        public void Setup(int delay, System.Collections.IList assemblies)
#endif
		{
            log.Info("Setting up watcher");

			files = new FileInfo[assemblies.Count];
			fileWatchers = new FileSystemWatcher[assemblies.Count];

			for (int i = 0; i < assemblies.Count; i++)
			{
                log.Debug("Setting up FileSystemWatcher for {0}", assemblies[i]);
                
				files[i] = new FileInfo((string)assemblies[i]);

				fileWatchers[i] = new FileSystemWatcher();
				fileWatchers[i].Path = files[i].DirectoryName;
				fileWatchers[i].Filter = files[i].Name;
				fileWatchers[i].NotifyFilter = NotifyFilters.Size | NotifyFilters.LastWrite;
				fileWatchers[i].Changed += new FileSystemEventHandler(OnChanged);
				fileWatchers[i].EnableRaisingEvents = false;
			}

			timer = new System.Timers.Timer(delay);
			timer.AutoReset = false;
			timer.Enabled = false;
			timer.Elapsed += new ElapsedEventHandler(OnTimer);
		}
 public Scoreboard(string guidFromMain = "", Classes.CustomSnapshotRoot root = null)
 {
     guid = guidFromMain;
     Classes.Logger.addLog("Opened scoreboard on server -> " + guid);
     InitializeComponent();
     if(root != null)
     {
         Classes.ScoreboardRenderer render = new Classes.ScoreboardRenderer(this, root.snapshot.mapId, root);
         Classes.Logger.addLog("Enabled initial render: ");
     }
     else
     {
         _timer = new System.Timers.Timer(3000);
         _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
         _timer.Enabled = true; // Enable it
         _timer_Elapsed(this, null);
     }
     if(MainWindow.keeperSettings.ScoreboardBackgrounds == false)
     {
         BackgroundAnimation.Stop();
         BackgroundAnimation.Visibility = Visibility.Hidden;
     }
     else
     {
         BackgroundAnimation.Play();
     }
 }
Esempio n. 22
0
        public Timer[] GetTimerForElement(string element)
        {
            Timer[] timersForElement = new Timer[2];
            _timers.TryGetValue(element, out timersForElement);

            return timersForElement;
        }
Esempio n. 23
0
 public StressTest()
 {
     InitializeComponent();
     tmr = new Timer(500);
     tmr.Elapsed += new ElapsedEventHandler(tmr_Elapsed);
     tmr.Start();
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySqlInputAdapter"/> class.
 /// </summary>
 public MySqlInputAdapter()
 {
     m_timer = new Timer();
     m_inputInterval = 33;
     m_measurementsPerInput = 5;
     m_fakeTimestamps = false;
 }
Esempio n. 25
0
        public MainWindow()
        {
            InitializeComponent();

            System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
            customCulture.NumberFormat.NumberDecimalSeparator = ".";

            System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;

            service = Service.getInstance(this);
            CourseModeSelect.Items.Add(new ComboboxItem("Synchronous", "Synchronous"));
            CourseModeSelect.Items.Add(new ComboboxItem("Asynchronous", "Asynchronous"));
            CourseModeSelect.Items.Add(new ComboboxItem("Self-Paced", "Self-Paced"));

            PrompterModeSelect.Items.Add(new ComboboxItem("Synchronous", "Synchronous"));
            PrompterModeSelect.Items.Add(new ComboboxItem("Asynchronous", "Asynchronous"));
            PrompterModeSelect.Items.Add(new ComboboxItem("Self-Paced", "Self-Paced"));

            sequenceTimer = new System.Timers.Timer();
            sequenceTimer.Interval = 100;
            sequenceTimer.Elapsed += Sequence_Timer_TickEvent;

            Mic1_VolumeBar.DataContext = this;
            Mic2_VolumeBar.DataContext = this;

            service.getMicrophoneList();
            WM1_groupbox.DataContext = service.wm1_data_context;
            WM2_groupbox.DataContext = service.wm2_data_context;

            Mic1_VolumeBar.DataContext = service.mic_data_context;
            Microphone1_ComboBox.ItemsSource = service.mic_data_context.Mics;
            Mic2_VolumeBar.DataContext = service.mic_data_context;
            Microphone2_ComboBox.ItemsSource = service.mic_data_context.Mics;
        }
Esempio n. 26
0
 public void Run(CancellationToken token)
 {
     _cancellationToken = token;
     _timer = new System.Timers.Timer(1000);
     _timer.Elapsed += Timer_Elapsed;
     _timer.Enabled = true;
 }
Esempio n. 27
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Settings);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            counter = 0;
            var prefs =
                AndroidAppPreferences.Create(Application.Context.GetSharedPreferences(KeySndrApplication.AppPreferencesId, FileCreationMode.Private));

            editIpView = FindViewById<EditText>(Resource.Id.ipEditText);
            editPortView = FindViewById<EditText>(Resource.Id.portEditText);
            useCacheView = FindViewById<CheckBox>(Resource.Id.enableCache);

            if (!string.IsNullOrEmpty(prefs.Ip))
                editIpView.Text = prefs.Ip;
            if (prefs.Port > 0)
                editPortView.Text = prefs.Port.ToString();
            useCacheView.Checked = prefs.UseCache;

            probe = new Probe("KeySndrServer");
            probe.BeaconsUpdated += Probe_BeaconsUpdated;


            t = new Timer(1000);
            t.Elapsed += TimerOnElapsed;
            if (Intent.Extras == null || !Intent.Extras.ContainsKey("search"))
                return;
        }
Esempio n. 28
0
 public void Start()
 {
     _log.Info("starting");
     _timer = new Timer(TimeSpan.FromMilliseconds(100).TotalMilliseconds);
     _timer.Elapsed += doWork;
     _timer.Enabled = true;
 }
        public DashboardView()
        {
            InitializeComponent();

            AndonManager = new AndonManager(StationList, null, Andonmanager.AndonManager.MODE.MASTER);

            AndonManager.start();
            StationList = new Queue<int>();

            Plans = new Plans();
            PlanGrid.DataContext = Plans;

            Actuals = new Models.Actuals();
            ActualGrid.DataContext = Actuals;

            AppTimer = new Timer(1000);
            AppTimer.AutoReset = false;
            AppTimer.Elapsed += AppTimer_Elapsed;

            EfficiencyWatch = new Stopwatch();

            using (PSBContext DBContext = new PSBContext())
            {

                Shifts = DBContext.Shifts.ToList();

                foreach (Shift s in Shifts)
                {
                    s.Update();
                }

            }

            AppTimer.Start();
        }
Esempio n. 30
0
 /// <summary>
 /// Creates new command which executes after the
 /// specified delay.
 /// </summary>
 /// <param name="delay">Delay in milliseconds</param>
 public AbstractCommand(int delay)
 {
     this._timer = new Timer(delay);
     this._timer.AutoReset = false;
     this._timer.Elapsed += new ElapsedEventHandler(this.OnTimerElapsed);
     this._isCompleted = false;
 }