Advertisement
Guest User

Untitled

a guest
Nov 19th, 2010
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.14 KB | None | 0 0
  1.     [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Users")]
  2.     public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
  3.     {
  4.        
  5.         private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
  6.        
  7.         private int _Id;
  8.        
  9.         private string _Name;
  10.        
  11.         private string _Password;
  12.        
  13.         private string _Email;
  14.        
  15.     #region Extensibility Method Definitions
  16.     partial void OnLoaded();
  17.     partial void OnValidate(System.Data.Linq.ChangeAction action);
  18.     partial void OnCreated();
  19.     partial void OnIdChanging(int value);
  20.     partial void OnIdChanged();
  21.     partial void OnNameChanging(string value);
  22.     partial void OnNameChanged();
  23.     partial void OnPasswordChanging(string value);
  24.     partial void OnPasswordChanged();
  25.     partial void OnEmailChanging(string value);
  26.     partial void OnEmailChanged();
  27.     #endregion
  28.        
  29.         public User()
  30.         {
  31.             OnCreated();
  32.         }
  33.        
  34.         [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
  35.         public int Id
  36.         {
  37.             get
  38.             {
  39.                 return this._Id;
  40.             }
  41.             set
  42.             {
  43.                 if ((this._Id != value))
  44.                 {
  45.                     this.OnIdChanging(value);
  46.                     this.SendPropertyChanging();
  47.                     this._Id = value;
  48.                     this.SendPropertyChanged("Id");
  49.                     this.OnIdChanged();
  50.                 }
  51.             }
  52.         }
  53.        
  54.         [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
  55.         public string Name
  56.         {
  57.             get
  58.             {
  59.                 return this._Name;
  60.             }
  61.             set
  62.             {
  63.                 if ((this._Name != value))
  64.                 {
  65.                     this.OnNameChanging(value);
  66.                     this.SendPropertyChanging();
  67.                     this._Name = value;
  68.                     this.SendPropertyChanged("Name");
  69.                     this.OnNameChanged();
  70.                 }
  71.             }
  72.         }
  73.        
  74.         [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Password", DbType="Char(40)")]
  75.         public string Password
  76.         {
  77.             get
  78.             {
  79.                 return this._Password;
  80.             }
  81.             set
  82.             {
  83.                 if ((this._Password != value))
  84.                 {
  85.                     this.OnPasswordChanging(value);
  86.                     this.SendPropertyChanging();
  87.                     this._Password = value;
  88.                     this.SendPropertyChanged("Password");
  89.                     this.OnPasswordChanged();
  90.                 }
  91.             }
  92.         }
  93.        
  94.         [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Email", DbType="VarChar(256)")]
  95.         public string Email
  96.         {
  97.             get
  98.             {
  99.                 return this._Email;
  100.             }
  101.             set
  102.             {
  103.                 if ((this._Email != value))
  104.                 {
  105.                     this.OnEmailChanging(value);
  106.                     this.SendPropertyChanging();
  107.                     this._Email = value;
  108.                     this.SendPropertyChanged("Email");
  109.                     this.OnEmailChanged();
  110.                 }
  111.             }
  112.         }
  113.        
  114.         public event PropertyChangingEventHandler PropertyChanging;
  115.        
  116.         public event PropertyChangedEventHandler PropertyChanged;
  117.        
  118.         protected virtual void SendPropertyChanging()
  119.         {
  120.             if ((this.PropertyChanging != null))
  121.             {
  122.                 this.PropertyChanging(this, emptyChangingEventArgs);
  123.             }
  124.         }
  125.        
  126.         protected virtual void SendPropertyChanged(String propertyName)
  127.         {
  128.             if ((this.PropertyChanged != null))
  129.             {
  130.                 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  131.             }
  132.         }
  133.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement