⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formula1.designer.cs

📁 C#高级编程第6版随书源代码 值得下载
💻 CS
📖 第 1 页 / 共 2 页
字号:
					if (this._Circuit.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCircuitIdChanging(value);
					this.SendPropertyChanging();
					this._CircuitId = value;
					this.SendPropertyChanged("CircuitId");
					this.OnCircuitIdChanged();
				}
			}
		}
		
		[Column(Storage="_Date", DbType="DateTime NOT NULL")]
		public System.DateTime Date
		{
			get
			{
				return this._Date;
			}
			set
			{
				if ((this._Date != value))
				{
					this.OnDateChanging(value);
					this.SendPropertyChanging();
					this._Date = value;
					this.SendPropertyChanged("Date");
					this.OnDateChanged();
				}
			}
		}
		
		[Association(Name="Race_RaceResult", Storage="_RaceResults", OtherKey="RaceId")]
		public EntitySet<RaceResult> RaceResults
		{
			get
			{
				return this._RaceResults;
			}
			set
			{
				this._RaceResults.Assign(value);
			}
		}
		
		[Association(Name="Circuit_Race", Storage="_Circuit", ThisKey="CircuitId", IsForeignKey=true)]
		public Circuit Circuit
		{
			get
			{
				return this._Circuit.Entity;
			}
			set
			{
				Circuit previousValue = this._Circuit.Entity;
				if (((previousValue != value) 
							|| (this._Circuit.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Circuit.Entity = null;
						previousValue.Races.Remove(this);
					}
					this._Circuit.Entity = value;
					if ((value != null))
					{
						value.Races.Add(this);
						this._CircuitId = value.Id;
					}
					else
					{
						this._CircuitId = default(int);
					}
					this.SendPropertyChanged("Circuit");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_RaceResults(RaceResult entity)
		{
			this.SendPropertyChanging();
			entity.Race = this;
		}
		
		private void detach_RaceResults(RaceResult entity)
		{
			this.SendPropertyChanging();
			entity.Race = null;
		}
	}
	
	[Table(Name="dbo.Racers")]
	public partial class Racer : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private string _Firstname;
		
		private string _Lastname;
		
		private string _Country;
		
		private System.Nullable<int> _Starts;
		
		private System.Nullable<int> _Wins;
		
		private EntitySet<RaceResult> _RaceResults;
		
    #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 OnFirstnameChanging(string value);
    partial void OnFirstnameChanged();
    partial void OnLastnameChanging(string value);
    partial void OnLastnameChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnStartsChanging(System.Nullable<int> value);
    partial void OnStartsChanged();
    partial void OnWinsChanging(System.Nullable<int> value);
    partial void OnWinsChanged();
    #endregion
		
		public Racer()
		{
			this._RaceResults = new EntitySet<RaceResult>(new Action<RaceResult>(this.attach_RaceResults), new Action<RaceResult>(this.detach_RaceResults));
			OnCreated();
		}
		
		[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", 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="_Firstname", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Firstname
		{
			get
			{
				return this._Firstname;
			}
			set
			{
				if ((this._Firstname != value))
				{
					this.OnFirstnameChanging(value);
					this.SendPropertyChanging();
					this._Firstname = value;
					this.SendPropertyChanged("Firstname");
					this.OnFirstnameChanged();
				}
			}
		}
		
		[Column(Storage="_Lastname", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Lastname
		{
			get
			{
				return this._Lastname;
			}
			set
			{
				if ((this._Lastname != value))
				{
					this.OnLastnameChanging(value);
					this.SendPropertyChanging();
					this._Lastname = value;
					this.SendPropertyChanged("Lastname");
					this.OnLastnameChanged();
				}
			}
		}
		
		[Column(Storage="_Country", DbType="NVarChar(50)")]
		public string Country
		{
			get
			{
				return this._Country;
			}
			set
			{
				if ((this._Country != value))
				{
					this.OnCountryChanging(value);
					this.SendPropertyChanging();
					this._Country = value;
					this.SendPropertyChanged("Country");
					this.OnCountryChanged();
				}
			}
		}
		
		[Column(Storage="_Starts", DbType="Int")]
		public System.Nullable<int> Starts
		{
			get
			{
				return this._Starts;
			}
			set
			{
				if ((this._Starts != value))
				{
					this.OnStartsChanging(value);
					this.SendPropertyChanging();
					this._Starts = value;
					this.SendPropertyChanged("Starts");
					this.OnStartsChanged();
				}
			}
		}
		
		[Column(Storage="_Wins", DbType="Int")]
		public System.Nullable<int> Wins
		{
			get
			{
				return this._Wins;
			}
			set
			{
				if ((this._Wins != value))
				{
					this.OnWinsChanging(value);
					this.SendPropertyChanging();
					this._Wins = value;
					this.SendPropertyChanged("Wins");
					this.OnWinsChanged();
				}
			}
		}
		
		[Association(Name="Racer_RaceResult", Storage="_RaceResults", OtherKey="RacerId")]
		public EntitySet<RaceResult> RaceResults
		{
			get
			{
				return this._RaceResults;
			}
			set
			{
				this._RaceResults.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_RaceResults(RaceResult entity)
		{
			this.SendPropertyChanging();
			entity.Racer = this;
		}
		
		private void detach_RaceResults(RaceResult entity)
		{
			this.SendPropertyChanging();
			entity.Racer = null;
		}
	}
	
	[Table(Name="dbo.Circuit")]
	public partial class Circuit : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _Id;
		
		private string _Name;
		
		private string _Country;
		
		private EntitySet<Race> _Races;
		
    #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 OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    #endregion
		
		public Circuit()
		{
			this._Races = new EntitySet<Race>(new Action<Race>(this.attach_Races), new Action<Race>(this.detach_Races));
			OnCreated();
		}
		
		[Column(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", 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="_Name", DbType="NVarChar(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="_Country", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Country
		{
			get
			{
				return this._Country;
			}
			set
			{
				if ((this._Country != value))
				{
					this.OnCountryChanging(value);
					this.SendPropertyChanging();
					this._Country = value;
					this.SendPropertyChanged("Country");
					this.OnCountryChanged();
				}
			}
		}
		
		[Association(Name="Circuit_Race", Storage="_Races", OtherKey="CircuitId")]
		public EntitySet<Race> Races
		{
			get
			{
				return this._Races;
			}
			set
			{
				this._Races.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Races(Race entity)
		{
			this.SendPropertyChanging();
			entity.Circuit = this;
		}
		
		private void detach_Races(Race entity)
		{
			this.SendPropertyChanging();
			entity.Circuit = null;
		}
	}
}
#pragma warning restore 1591

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -