private void StartTimer_Tick(object sender, EventArgs e) { ProgTimer.Stop(); StartTimer.Stop(); this.Text = mTitle + ": Typing now..."; // Load text into memory if (this.mIsClipboardAction) { mTextToSend = Clipboard.GetText(TextDataFormat.UnicodeText); } else { mTextToSend = TextBuffer.Text; } // remove unwanted chars and set start typing pos mTextToSend = mTextToSend.Replace("\r", ""); mTextToSendIdx = 0; // Set progress bar output ProgBar.Value = 0; ProgBar.Minimum = 0; ProgBar.Maximum = mTextToSend.Length; // Start send of the text mStartTextSend = true; TxtTimer.Interval = (int)DelayCharsSendNum.Value; TxtTimer.Start(); }
/// <summary> /// Initialize class components /// </summary> protected HasherBase() { //runner this.runner = new BackgroundWorker(); this.runner.WorkerSupportsCancellation = true; this.runner.DoWork += new DoWorkEventHandler(this.BGWInitTasks); this.runner.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BWGRunWorkerCompleted); //priorityRnr this.priorityRnr = new BackgroundWorker(); this.priorityRnr.WorkerSupportsCancellation = true; this.priorityRnr.DoWork += new DoWorkEventHandler(this.BeginPriorityTasks); this.priorityRnr.RunWorkerCompleted += new RunWorkerCompletedEventHandler(PriorityTaskCompleted); //hashTimer this.hashTimer = new ProgTimer(TimerType.ResultHash, TimerType.WriteOutput); //init. the search engine. this.brain = new SearchBrain(); //initialize other stuff MaxPerFolder = SearchBrain.List.MaxPerFolder; Thread.CurrentThread.IsBackground = true; Thread.CurrentThread.Priority = ThreadPriority.Highest; results = new ResultList(); Cache = new ResultList(); hashTimer.TimerFired += new HashTimerEventHandler(this.OnTimerFired); results.ItemNotFound += new HashItemSearchHandler(this.OnItemNotFound); }
private void startAutoTypeAction(Boolean isClipboardAction) { this.mIsClipboardAction = isClipboardAction; this.Text = mTitle + ": Delaying " + ((int)DelayStartSecsNum.Value).ToString() + " seconds before typing.."; mStartTextSend = false; StartTimer.Interval = ((int)DelayStartSecsNum.Value * 1000); ProgBar.Maximum = StartTimer.Interval / ProgTimer.Interval; ProgBar.Minimum = 0; ProgBar.Value = ProgBar.Maximum; ProgBar.Refresh(); StartTimer.Start(); ProgTimer.Start(); }
/// <summary> /// Default ctor /// </summary> /// <param name="wildcards"></param> internal TaskPoller(WildCardCollection wildcards, Rule[] rules, ILog logger) { this.logger = logger; Thread.CurrentThread.IsBackground = true; Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; this.Rules = rules; this.Events = new ManualResetEvents(); this.tmpEvents = new ManualResetEvents(); this.pollTimer = new ProgTimer(TimerType.HashDelay); this.pollTimer.TimerFired += new HashTimerEventHandler(pollTimer_TimerFired); this.wildcards = wildcards; Poll = new ProcessList(); CompletedDirs = new List <string>(); Results = new List <string>(); CreateTasks(); }
public MassNotifier() { //initialize writers, timers, layouts and log queue v_writer = new LogWriter(this); logQueue = new LogQueue(); timer = new ProgTimer(); this.v_configurator = new LayoutConfigurator(); //setup writer thread stuff this.writeStart = new ThreadStart(this.MassAppend); this.massThread = new Thread(writeStart); this.massThread.IsBackground = true; //set other parameters v_append = true; v_logmode = LogMode.Immediate; //GetModeAction(); }