#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.4952
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;



[System.Data.Linq.Mapping.DatabaseAttribute(Name="DayPilotRecurrence")]
public partial class DayPilotDataClassesDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertEvent(Event instance);
  partial void UpdateEvent(Event instance);
  partial void DeleteEvent(Event instance);
  #endregion
	
	public DayPilotDataClassesDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["daypilotConnectionString"].ConnectionString, mappingSource)
	{
		OnCreated();
	}
	
	public DayPilotDataClassesDataContext(string connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DayPilotDataClassesDataContext(System.Data.IDbConnection connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DayPilotDataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DayPilotDataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public System.Data.Linq.Table<Event> Events
	{
		get
		{
			return this.GetTable<Event>();
		}
	}
}

[Table(Name="dbo.Events")]
public partial class Event : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _id;
	
	private System.DateTime _eventstart;
	
	private System.DateTime _eventend;
	
	private string _name;
	
	private string _recurrence;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OneventstartChanging(System.DateTime value);
    partial void OneventstartChanged();
    partial void OneventendChanging(System.DateTime value);
    partial void OneventendChanged();
    partial void OnnameChanging(string value);
    partial void OnnameChanged();
    partial void OnrecurrenceChanging(string value);
    partial void OnrecurrenceChanged();
    #endregion
	
	public Event()
	{
		OnCreated();
	}
	
	[Column(Storage="_id", DbType="Int NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
	public int id
	{
		get
		{
			return this._id;
		}
		set
		{
			if ((this._id != value))
			{
				this.OnidChanging(value);
				this.SendPropertyChanging();
				this._id = value;
				this.SendPropertyChanged("id");
				this.OnidChanged();
			}
		}
	}
	
	[Column(Storage="_eventstart", DbType="DateTime NOT NULL")]
	public System.DateTime eventstart
	{
		get
		{
			return this._eventstart;
		}
		set
		{
			if ((this._eventstart != value))
			{
				this.OneventstartChanging(value);
				this.SendPropertyChanging();
				this._eventstart = value;
				this.SendPropertyChanged("eventstart");
				this.OneventstartChanged();
			}
		}
	}
	
	[Column(Storage="_eventend", DbType="DateTime NOT NULL")]
	public System.DateTime eventend
	{
		get
		{
			return this._eventend;
		}
		set
		{
			if ((this._eventend != value))
			{
				this.OneventendChanging(value);
				this.SendPropertyChanging();
				this._eventend = value;
				this.SendPropertyChanged("eventend");
				this.OneventendChanged();
			}
		}
	}
	
	[Column(Storage="_name", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
	public string name
	{
		get
		{
			return this._name;
		}
		set
		{
			if ((this._name != value))
			{
				this.OnnameChanging(value);
				this.SendPropertyChanging();
				this._name = value;
				this.SendPropertyChanged("name");
				this.OnnameChanged();
			}
		}
	}
	
	[Column(Storage="_recurrence", DbType="VarChar(300)")]
	public string recurrence
	{
		get
		{
			return this._recurrence;
		}
		set
		{
			if ((this._recurrence != value))
			{
				this.OnrecurrenceChanging(value);
				this.SendPropertyChanging();
				this._recurrence = value;
				this.SendPropertyChanged("recurrence");
				this.OnrecurrenceChanged();
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}
#pragma warning restore 1591
