Click here to Skip to main content
15,886,362 members
Articles / Code generation

Semi generated crawler

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
22 Jun 2012CPOL4 min read 21.6K   599   10  
Leverage Visual studio Web Test Framework for your crawling needs...
using System;
namespace LightWebTestFramework
{
	internal abstract class Recorder
	{
		private object m_senderObject = new object();
		protected RecordingState m_recordingState = RecordingState.Paused;
		public event EventHandler<RequestRecordedEventArgs> RequestRecorded;
		public event EventHandler<HiddenFieldsFoundEventArgs> HiddenFieldsFound;
		public event EventHandler<ThinkTimeMeasuredEventArgs> ThinkTimeMeasured;
		public event EventHandler<DependentsParsedEventArgs> DependentsParsed;
		public event EventHandler<ResponseTimeUpdatedEventArgs> ResponseTimeUpdated;
		public RecordingState RecordingState
		{
			get
			{
				return this.m_recordingState;
			}
		}
		public abstract void Start();
		public abstract void Pause();
		public abstract void Stop();
		protected void RaiseRequestRecorded(RequestRecordedEventArgs e)
		{
			if (this.RequestRecorded != null)
			{
				this.RequestRecorded(this.m_senderObject, e);
			}
		}
		protected void RaiseHiddenFieldsFound(HiddenFieldsFoundEventArgs e)
		{
			if (this.HiddenFieldsFound != null)
			{
				this.HiddenFieldsFound(this.m_senderObject, e);
			}
		}
		protected void RaiseThinkTimeMeasured(ThinkTimeMeasuredEventArgs e)
		{
			if (this.ThinkTimeMeasured != null)
			{
				this.ThinkTimeMeasured(this.m_senderObject, e);
			}
		}
		protected void RaiseResponseTimeUpdated(ResponseTimeUpdatedEventArgs e)
		{
			if (this.ResponseTimeUpdated != null)
			{
				this.ResponseTimeUpdated(this.m_senderObject, e);
			}
		}
		protected void RaiseDependentsParsed(DependentsParsedEventArgs e)
		{
			if (this.DependentsParsed != null)
			{
				this.DependentsParsed(this.m_senderObject, e);
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Freelance
France France
I am currently the CTO of Metaco, we are leveraging the Bitcoin Blockchain for delivering financial services.

I also developed a tool to make IaaS on Azure more easy to use IaaS Management Studio.

If you want to contact me, go this way Smile | :)

Comments and Discussions