diff options
Diffstat (limited to 'samples')
-rw-r--r-- | samples/Consumer/App_Code/TracePageAppender.cs | 22 | ||||
-rw-r--r-- | samples/Consumer/TracePage.aspx.cs | 42 | ||||
-rw-r--r-- | samples/ConsumerWpf/App.xaml.cs | 28 | ||||
-rw-r--r-- | samples/ConsumerWpf/Properties/AssemblyInfo.cs | 92 | ||||
-rw-r--r-- | samples/ServiceProvider/App_Code/DataApi.cs | 40 | ||||
-rw-r--r-- | samples/ServiceProvider/App_Code/DataClasses.designer.cs | 1846 | ||||
-rw-r--r-- | samples/ServiceProvider/App_Code/IDataApi.cs | 36 | ||||
-rw-r--r-- | samples/ServiceProvider/App_Code/TokenAuthorizationState.cs | 48 | ||||
-rw-r--r-- | samples/ServiceProvider/App_Code/TracePageAppender.cs | 22 | ||||
-rw-r--r-- | samples/ServiceProvider/Members/AuthorizedConsumers.aspx.cs | 30 | ||||
-rw-r--r-- | samples/ServiceProvider/TracePage.aspx.cs | 42 |
11 files changed, 1124 insertions, 1124 deletions
diff --git a/samples/Consumer/App_Code/TracePageAppender.cs b/samples/Consumer/App_Code/TracePageAppender.cs index b3b539a..93ec9e3 100644 --- a/samples/Consumer/App_Code/TracePageAppender.cs +++ b/samples/Consumer/App_Code/TracePageAppender.cs @@ -1,11 +1,11 @@ -using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Web;
-
-public class TracePageAppender : log4net.Appender.AppenderSkeleton {
- protected override void Append(log4net.Core.LoggingEvent loggingEvent) {
- StringWriter sw = new StringWriter(Logging.LogMessages);
- Layout.Format(sw, loggingEvent);
- }
-}
+using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +public class TracePageAppender : log4net.Appender.AppenderSkeleton { + protected override void Append(log4net.Core.LoggingEvent loggingEvent) { + StringWriter sw = new StringWriter(Logging.LogMessages); + Layout.Format(sw, loggingEvent); + } +} diff --git a/samples/Consumer/TracePage.aspx.cs b/samples/Consumer/TracePage.aspx.cs index 47e217b..526ab69 100644 --- a/samples/Consumer/TracePage.aspx.cs +++ b/samples/Consumer/TracePage.aspx.cs @@ -1,21 +1,21 @@ -using System;
-using System.Collections.Generic;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-/// <summary>
-/// A page to display recent log messages.
-/// </summary>
-public partial class TracePage : System.Web.UI.Page {
- protected void Page_Load(object sender, EventArgs e) {
- placeHolder1.Controls.Add(new Label { Text = Logging.LogMessages.ToString() });
- }
-
- protected void clearLogButton_Click(object sender, EventArgs e) {
- Logging.LogMessages.Length = 0;
-
- // clear the page immediately, and allow for F5 without a Postback warning.
- Response.Redirect(Request.Url.AbsoluteUri);
- }
-}
+using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +/// <summary> +/// A page to display recent log messages. +/// </summary> +public partial class TracePage : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + placeHolder1.Controls.Add(new Label { Text = Logging.LogMessages.ToString() }); + } + + protected void clearLogButton_Click(object sender, EventArgs e) { + Logging.LogMessages.Length = 0; + + // clear the page immediately, and allow for F5 without a Postback warning. + Response.Redirect(Request.Url.AbsoluteUri); + } +} diff --git a/samples/ConsumerWpf/App.xaml.cs b/samples/ConsumerWpf/App.xaml.cs index 075d6f6..337cd37 100644 --- a/samples/ConsumerWpf/App.xaml.cs +++ b/samples/ConsumerWpf/App.xaml.cs @@ -1,14 +1,14 @@ -namespace ConsumerWpf {
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Data;
- using System.Linq;
- using System.Windows;
-
- /// <summary>
- /// Interaction logic for App.xaml
- /// </summary>
- public partial class App : Application {
- }
-}
+namespace ConsumerWpf { + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Data; + using System.Linq; + using System.Windows; + + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application { + } +} diff --git a/samples/ConsumerWpf/Properties/AssemblyInfo.cs b/samples/ConsumerWpf/Properties/AssemblyInfo.cs index d54cc97..85e6239 100644 --- a/samples/ConsumerWpf/Properties/AssemblyInfo.cs +++ b/samples/ConsumerWpf/Properties/AssemblyInfo.cs @@ -1,46 +1,46 @@ -using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ConsumerWpf")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ConsumerWpf")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// In order to begin building localizable applications, set
-// <UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
-// inside a <PropertyGroup>. For example, if you are using US english
-// in your source files, set the <UICulture> to en-US. Then uncomment
-// the NeutralResourceLanguage attribute below. Update the "en-US" in
-// the line below to match the UICulture setting in the project file.
-
-////[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ConsumerWpf")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ConsumerWpf")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// In order to begin building localizable applications, set +// <UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +// inside a <PropertyGroup>. For example, if you are using US english +// in your source files, set the <UICulture> to en-US. Then uncomment +// the NeutralResourceLanguage attribute below. Update the "en-US" in +// the line below to match the UICulture setting in the project file. + +////[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + +[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/ServiceProvider/App_Code/DataApi.cs b/samples/ServiceProvider/App_Code/DataApi.cs index ecd3618..a765159 100644 --- a/samples/ServiceProvider/App_Code/DataApi.cs +++ b/samples/ServiceProvider/App_Code/DataApi.cs @@ -1,20 +1,20 @@ -using System.Linq;
-using System.ServiceModel;
-
-public class DataApi : IDataApi {
- private static OAuthToken AccessToken {
- get { return OperationContext.Current.IncomingMessageProperties["OAuthAccessToken"] as OAuthToken; }
- }
-
- public int? GetAge() {
- return AccessToken.User.Age;
- }
-
- public string GetName() {
- return AccessToken.User.FullName;
- }
-
- public string[] GetFavoriteSites() {
- return AccessToken.User.FavoriteSites.Select(site => site.SiteUrl).ToArray();
- }
-}
+using System.Linq; +using System.ServiceModel; + +public class DataApi : IDataApi { + private static OAuthToken AccessToken { + get { return OperationContext.Current.IncomingMessageProperties["OAuthAccessToken"] as OAuthToken; } + } + + public int? GetAge() { + return AccessToken.User.Age; + } + + public string GetName() { + return AccessToken.User.FullName; + } + + public string[] GetFavoriteSites() { + return AccessToken.User.FavoriteSites.Select(site => site.SiteUrl).ToArray(); + } +} diff --git a/samples/ServiceProvider/App_Code/DataClasses.designer.cs b/samples/ServiceProvider/App_Code/DataClasses.designer.cs index 612cd75..2fc532e 100644 --- a/samples/ServiceProvider/App_Code/DataClasses.designer.cs +++ b/samples/ServiceProvider/App_Code/DataClasses.designer.cs @@ -1,923 +1,923 @@ -#pragma warning disable 1591
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3053
-//
-// 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="Database")]
-public partial class DataClassesDataContext : System.Data.Linq.DataContext
-{
-
- private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
-
- #region Extensibility Method Definitions
- partial void OnCreated();
- partial void InsertUser(User instance);
- partial void UpdateUser(User instance);
- partial void DeleteUser(User instance);
- partial void InsertFavoriteSite(FavoriteSite instance);
- partial void UpdateFavoriteSite(FavoriteSite instance);
- partial void DeleteFavoriteSite(FavoriteSite instance);
- partial void InsertOAuthConsumer(OAuthConsumer instance);
- partial void UpdateOAuthConsumer(OAuthConsumer instance);
- partial void DeleteOAuthConsumer(OAuthConsumer instance);
- partial void InsertOAuthToken(OAuthToken instance);
- partial void UpdateOAuthToken(OAuthToken instance);
- partial void DeleteOAuthToken(OAuthToken instance);
- #endregion
-
- public DataClassesDataContext() :
- base(global::System.Configuration.ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString, mappingSource)
- {
- OnCreated();
- }
-
- public DataClassesDataContext(string connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public DataClassesDataContext(System.Data.IDbConnection connection) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- OnCreated();
- }
-
- public System.Data.Linq.Table<User> Users
- {
- get
- {
- return this.GetTable<User>();
- }
- }
-
- public System.Data.Linq.Table<FavoriteSite> FavoriteSites
- {
- get
- {
- return this.GetTable<FavoriteSite>();
- }
- }
-
- public System.Data.Linq.Table<OAuthConsumer> OAuthConsumers
- {
- get
- {
- return this.GetTable<OAuthConsumer>();
- }
- }
-
- public System.Data.Linq.Table<OAuthToken> OAuthTokens
- {
- get
- {
- return this.GetTable<OAuthToken>();
- }
- }
-}
-
-[Table(Name="dbo.[User]")]
-public partial class User : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _UserId;
-
- private string _OpenIDClaimedIdentifier;
-
- private string _OpenIDFriendlyIdentifier;
-
- private string _FullName;
-
- private System.Nullable<int> _Age;
-
- private EntitySet<FavoriteSite> _FavoriteSites;
-
- private EntitySet<OAuthToken> _OAuthTokens;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnUserIdChanging(int value);
- partial void OnUserIdChanged();
- partial void OnOpenIDClaimedIdentifierChanging(string value);
- partial void OnOpenIDClaimedIdentifierChanged();
- partial void OnOpenIDFriendlyIdentifierChanging(string value);
- partial void OnOpenIDFriendlyIdentifierChanged();
- partial void OnFullNameChanging(string value);
- partial void OnFullNameChanged();
- partial void OnAgeChanging(System.Nullable<int> value);
- partial void OnAgeChanged();
- #endregion
-
- public User()
- {
- this._FavoriteSites = new EntitySet<FavoriteSite>(new Action<FavoriteSite>(this.attach_FavoriteSites), new Action<FavoriteSite>(this.detach_FavoriteSites));
- this._OAuthTokens = new EntitySet<OAuthToken>(new Action<OAuthToken>(this.attach_OAuthTokens), new Action<OAuthToken>(this.detach_OAuthTokens));
- OnCreated();
- }
-
- [Column(Storage="_UserId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int UserId
- {
- get
- {
- return this._UserId;
- }
- set
- {
- if ((this._UserId != value))
- {
- this.OnUserIdChanging(value);
- this.SendPropertyChanging();
- this._UserId = value;
- this.SendPropertyChanged("UserId");
- this.OnUserIdChanged();
- }
- }
- }
-
- [Column(Storage="_OpenIDClaimedIdentifier", DbType="NVarChar(150) NOT NULL", CanBeNull=false)]
- public string OpenIDClaimedIdentifier
- {
- get
- {
- return this._OpenIDClaimedIdentifier;
- }
- set
- {
- if ((this._OpenIDClaimedIdentifier != value))
- {
- this.OnOpenIDClaimedIdentifierChanging(value);
- this.SendPropertyChanging();
- this._OpenIDClaimedIdentifier = value;
- this.SendPropertyChanged("OpenIDClaimedIdentifier");
- this.OnOpenIDClaimedIdentifierChanged();
- }
- }
- }
-
- [Column(Storage="_OpenIDFriendlyIdentifier", DbType="NVarChar(150)")]
- public string OpenIDFriendlyIdentifier
- {
- get
- {
- return this._OpenIDFriendlyIdentifier;
- }
- set
- {
- if ((this._OpenIDFriendlyIdentifier != value))
- {
- this.OnOpenIDFriendlyIdentifierChanging(value);
- this.SendPropertyChanging();
- this._OpenIDFriendlyIdentifier = value;
- this.SendPropertyChanged("OpenIDFriendlyIdentifier");
- this.OnOpenIDFriendlyIdentifierChanged();
- }
- }
- }
-
- [Column(Storage="_FullName", DbType="NVarChar(150)", CanBeNull=false)]
- public string FullName
- {
- get
- {
- return this._FullName;
- }
- set
- {
- if ((this._FullName != value))
- {
- this.OnFullNameChanging(value);
- this.SendPropertyChanging();
- this._FullName = value;
- this.SendPropertyChanged("FullName");
- this.OnFullNameChanged();
- }
- }
- }
-
- [Column(Storage="_Age", DbType="int")]
- public System.Nullable<int> Age
- {
- get
- {
- return this._Age;
- }
- set
- {
- if ((this._Age != value))
- {
- this.OnAgeChanging(value);
- this.SendPropertyChanging();
- this._Age = value;
- this.SendPropertyChanged("Age");
- this.OnAgeChanged();
- }
- }
- }
-
- [Association(Name="User_FavoriteSite", Storage="_FavoriteSites", ThisKey="UserId", OtherKey="UserId")]
- public EntitySet<FavoriteSite> FavoriteSites
- {
- get
- {
- return this._FavoriteSites;
- }
- set
- {
- this._FavoriteSites.Assign(value);
- }
- }
-
- [Association(Name="User_OAuthToken", Storage="_OAuthTokens", ThisKey="UserId", OtherKey="UserId")]
- public EntitySet<OAuthToken> OAuthTokens
- {
- get
- {
- return this._OAuthTokens;
- }
- set
- {
- this._OAuthTokens.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_FavoriteSites(FavoriteSite entity)
- {
- this.SendPropertyChanging();
- entity.User = this;
- }
-
- private void detach_FavoriteSites(FavoriteSite entity)
- {
- this.SendPropertyChanging();
- entity.User = null;
- }
-
- private void attach_OAuthTokens(OAuthToken entity)
- {
- this.SendPropertyChanging();
- entity.User = this;
- }
-
- private void detach_OAuthTokens(OAuthToken entity)
- {
- this.SendPropertyChanging();
- entity.User = null;
- }
-}
-
-[Table(Name="dbo.FavoriteSite")]
-public partial class FavoriteSite : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _FavoriteSiteId;
-
- private int _UserId;
-
- private string _SiteUrl;
-
- private EntityRef<User> _User;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnFavoriteSiteIdChanging(int value);
- partial void OnFavoriteSiteIdChanged();
- partial void OnUserIdChanging(int value);
- partial void OnUserIdChanged();
- partial void OnSiteUrlChanging(string value);
- partial void OnSiteUrlChanged();
- #endregion
-
- public FavoriteSite()
- {
- this._User = default(EntityRef<User>);
- OnCreated();
- }
-
- [Column(Storage="_FavoriteSiteId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int FavoriteSiteId
- {
- get
- {
- return this._FavoriteSiteId;
- }
- set
- {
- if ((this._FavoriteSiteId != value))
- {
- this.OnFavoriteSiteIdChanging(value);
- this.SendPropertyChanging();
- this._FavoriteSiteId = value;
- this.SendPropertyChanged("FavoriteSiteId");
- this.OnFavoriteSiteIdChanged();
- }
- }
- }
-
- [Column(Storage="_UserId", DbType="Int NOT NULL")]
- public int UserId
- {
- get
- {
- return this._UserId;
- }
- set
- {
- if ((this._UserId != value))
- {
- if (this._User.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnUserIdChanging(value);
- this.SendPropertyChanging();
- this._UserId = value;
- this.SendPropertyChanged("UserId");
- this.OnUserIdChanged();
- }
- }
- }
-
- [Column(Storage="_SiteUrl", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
- public string SiteUrl
- {
- get
- {
- return this._SiteUrl;
- }
- set
- {
- if ((this._SiteUrl != value))
- {
- this.OnSiteUrlChanging(value);
- this.SendPropertyChanging();
- this._SiteUrl = value;
- this.SendPropertyChanged("SiteUrl");
- this.OnSiteUrlChanged();
- }
- }
- }
-
- [Association(Name="User_FavoriteSite", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
- public User User
- {
- get
- {
- return this._User.Entity;
- }
- set
- {
- User previousValue = this._User.Entity;
- if (((previousValue != value)
- || (this._User.HasLoadedOrAssignedValue == false)))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._User.Entity = null;
- previousValue.FavoriteSites.Remove(this);
- }
- this._User.Entity = value;
- if ((value != null))
- {
- value.FavoriteSites.Add(this);
- this._UserId = value.UserId;
- }
- else
- {
- this._UserId = default(int);
- }
- this.SendPropertyChanged("User");
- }
- }
- }
-
- 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));
- }
- }
-}
-
-[Table(Name="dbo.OAuthConsumer")]
-public partial class OAuthConsumer : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _ConsumerId;
-
- private string _ConsumerKey;
-
- private string _ConsumerSecret;
-
- private EntitySet<OAuthToken> _OAuthTokens;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnConsumerIdChanging(int value);
- partial void OnConsumerIdChanged();
- partial void OnConsumerKeyChanging(string value);
- partial void OnConsumerKeyChanged();
- partial void OnConsumerSecretChanging(string value);
- partial void OnConsumerSecretChanged();
- #endregion
-
- public OAuthConsumer()
- {
- this._OAuthTokens = new EntitySet<OAuthToken>(new Action<OAuthToken>(this.attach_OAuthTokens), new Action<OAuthToken>(this.detach_OAuthTokens));
- OnCreated();
- }
-
- [Column(Storage="_ConsumerId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int ConsumerId
- {
- get
- {
- return this._ConsumerId;
- }
- set
- {
- if ((this._ConsumerId != value))
- {
- this.OnConsumerIdChanging(value);
- this.SendPropertyChanging();
- this._ConsumerId = value;
- this.SendPropertyChanged("ConsumerId");
- this.OnConsumerIdChanged();
- }
- }
- }
-
- [Column(Storage="_ConsumerKey", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
- public string ConsumerKey
- {
- get
- {
- return this._ConsumerKey;
- }
- set
- {
- if ((this._ConsumerKey != value))
- {
- this.OnConsumerKeyChanging(value);
- this.SendPropertyChanging();
- this._ConsumerKey = value;
- this.SendPropertyChanged("ConsumerKey");
- this.OnConsumerKeyChanged();
- }
- }
- }
-
- [Column(Storage="_ConsumerSecret", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
- public string ConsumerSecret
- {
- get
- {
- return this._ConsumerSecret;
- }
- set
- {
- if ((this._ConsumerSecret != value))
- {
- this.OnConsumerSecretChanging(value);
- this.SendPropertyChanging();
- this._ConsumerSecret = value;
- this.SendPropertyChanged("ConsumerSecret");
- this.OnConsumerSecretChanged();
- }
- }
- }
-
- [Association(Name="OAuthConsumer_OAuthToken", Storage="_OAuthTokens", ThisKey="ConsumerId", OtherKey="ConsumerId")]
- public EntitySet<OAuthToken> OAuthTokens
- {
- get
- {
- return this._OAuthTokens;
- }
- set
- {
- this._OAuthTokens.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_OAuthTokens(OAuthToken entity)
- {
- this.SendPropertyChanging();
- entity.OAuthConsumer = this;
- }
-
- private void detach_OAuthTokens(OAuthToken entity)
- {
- this.SendPropertyChanging();
- entity.OAuthConsumer = null;
- }
-}
-
-[Table(Name="dbo.OAuthToken")]
-public partial class OAuthToken : INotifyPropertyChanging, INotifyPropertyChanged
-{
-
- private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-
- private int _TokenId;
-
- private string _Token;
-
- private string _TokenSecret;
-
- private TokenAuthorizationState _State;
-
- private System.DateTime _IssueDate;
-
- private int _ConsumerId;
-
- private System.Nullable<int> _UserId;
-
- private string _Scope;
-
- private EntityRef<OAuthConsumer> _OAuthConsumer;
-
- private EntityRef<User> _User;
-
- #region Extensibility Method Definitions
- partial void OnLoaded();
- partial void OnValidate(System.Data.Linq.ChangeAction action);
- partial void OnCreated();
- partial void OnTokenIdChanging(int value);
- partial void OnTokenIdChanged();
- partial void OnTokenChanging(string value);
- partial void OnTokenChanged();
- partial void OnTokenSecretChanging(string value);
- partial void OnTokenSecretChanged();
- partial void OnStateChanging(TokenAuthorizationState value);
- partial void OnStateChanged();
- partial void OnIssueDateChanging(System.DateTime value);
- partial void OnIssueDateChanged();
- partial void OnConsumerIdChanging(int value);
- partial void OnConsumerIdChanged();
- partial void OnUserIdChanging(System.Nullable<int> value);
- partial void OnUserIdChanged();
- partial void OnScopeChanging(string value);
- partial void OnScopeChanged();
- #endregion
-
- public OAuthToken()
- {
- this._OAuthConsumer = default(EntityRef<OAuthConsumer>);
- this._User = default(EntityRef<User>);
- OnCreated();
- }
-
- [Column(Storage="_TokenId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
- public int TokenId
- {
- get
- {
- return this._TokenId;
- }
- set
- {
- if ((this._TokenId != value))
- {
- this.OnTokenIdChanging(value);
- this.SendPropertyChanging();
- this._TokenId = value;
- this.SendPropertyChanged("TokenId");
- this.OnTokenIdChanged();
- }
- }
- }
-
- [Column(Storage="_Token", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
- public string Token
- {
- get
- {
- return this._Token;
- }
- set
- {
- if ((this._Token != value))
- {
- this.OnTokenChanging(value);
- this.SendPropertyChanging();
- this._Token = value;
- this.SendPropertyChanged("Token");
- this.OnTokenChanged();
- }
- }
- }
-
- [Column(Storage="_TokenSecret", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
- public string TokenSecret
- {
- get
- {
- return this._TokenSecret;
- }
- set
- {
- if ((this._TokenSecret != value))
- {
- this.OnTokenSecretChanging(value);
- this.SendPropertyChanging();
- this._TokenSecret = value;
- this.SendPropertyChanged("TokenSecret");
- this.OnTokenSecretChanged();
- }
- }
- }
-
- [Column(Storage="_State", DbType="Int NOT NULL", CanBeNull=false)]
- public TokenAuthorizationState State
- {
- get
- {
- return this._State;
- }
- set
- {
- if ((this._State != value))
- {
- this.OnStateChanging(value);
- this.SendPropertyChanging();
- this._State = value;
- this.SendPropertyChanged("State");
- this.OnStateChanged();
- }
- }
- }
-
- [Column(Storage="_IssueDate", DbType="DateTime NOT NULL")]
- public System.DateTime IssueDate
- {
- get
- {
- return this._IssueDate;
- }
- set
- {
- if ((this._IssueDate != value))
- {
- this.OnIssueDateChanging(value);
- this.SendPropertyChanging();
- this._IssueDate = value;
- this.SendPropertyChanged("IssueDate");
- this.OnIssueDateChanged();
- }
- }
- }
-
- [Column(Storage="_ConsumerId", DbType="Int NOT NULL")]
- public int ConsumerId
- {
- get
- {
- return this._ConsumerId;
- }
- set
- {
- if ((this._ConsumerId != value))
- {
- if (this._OAuthConsumer.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnConsumerIdChanging(value);
- this.SendPropertyChanging();
- this._ConsumerId = value;
- this.SendPropertyChanged("ConsumerId");
- this.OnConsumerIdChanged();
- }
- }
- }
-
- [Column(Storage="_UserId", DbType="Int")]
- public System.Nullable<int> UserId
- {
- get
- {
- return this._UserId;
- }
- set
- {
- if ((this._UserId != value))
- {
- if (this._User.HasLoadedOrAssignedValue)
- {
- throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
- }
- this.OnUserIdChanging(value);
- this.SendPropertyChanging();
- this._UserId = value;
- this.SendPropertyChanged("UserId");
- this.OnUserIdChanged();
- }
- }
- }
-
- [Column(Storage="_Scope", DbType="nvarchar(MAX)", CanBeNull=false)]
- public string Scope
- {
- get
- {
- return this._Scope;
- }
- set
- {
- if ((this._Scope != value))
- {
- this.OnScopeChanging(value);
- this.SendPropertyChanging();
- this._Scope = value;
- this.SendPropertyChanged("Scope");
- this.OnScopeChanged();
- }
- }
- }
-
- [Association(Name="OAuthConsumer_OAuthToken", Storage="_OAuthConsumer", ThisKey="ConsumerId", OtherKey="ConsumerId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
- public OAuthConsumer OAuthConsumer
- {
- get
- {
- return this._OAuthConsumer.Entity;
- }
- set
- {
- OAuthConsumer previousValue = this._OAuthConsumer.Entity;
- if (((previousValue != value)
- || (this._OAuthConsumer.HasLoadedOrAssignedValue == false)))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._OAuthConsumer.Entity = null;
- previousValue.OAuthTokens.Remove(this);
- }
- this._OAuthConsumer.Entity = value;
- if ((value != null))
- {
- value.OAuthTokens.Add(this);
- this._ConsumerId = value.ConsumerId;
- }
- else
- {
- this._ConsumerId = default(int);
- }
- this.SendPropertyChanged("OAuthConsumer");
- }
- }
- }
-
- [Association(Name="User_OAuthToken", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteRule="CASCADE")]
- public User User
- {
- get
- {
- return this._User.Entity;
- }
- set
- {
- User previousValue = this._User.Entity;
- if (((previousValue != value)
- || (this._User.HasLoadedOrAssignedValue == false)))
- {
- this.SendPropertyChanging();
- if ((previousValue != null))
- {
- this._User.Entity = null;
- previousValue.OAuthTokens.Remove(this);
- }
- this._User.Entity = value;
- if ((value != null))
- {
- value.OAuthTokens.Add(this);
- this._UserId = value.UserId;
- }
- else
- {
- this._UserId = default(Nullable<int>);
- }
- this.SendPropertyChanged("User");
- }
- }
- }
-
- 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
+#pragma warning disable 1591 +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// 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="Database")] +public partial class DataClassesDataContext : System.Data.Linq.DataContext +{ + + private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); + + #region Extensibility Method Definitions + partial void OnCreated(); + partial void InsertUser(User instance); + partial void UpdateUser(User instance); + partial void DeleteUser(User instance); + partial void InsertFavoriteSite(FavoriteSite instance); + partial void UpdateFavoriteSite(FavoriteSite instance); + partial void DeleteFavoriteSite(FavoriteSite instance); + partial void InsertOAuthConsumer(OAuthConsumer instance); + partial void UpdateOAuthConsumer(OAuthConsumer instance); + partial void DeleteOAuthConsumer(OAuthConsumer instance); + partial void InsertOAuthToken(OAuthToken instance); + partial void UpdateOAuthToken(OAuthToken instance); + partial void DeleteOAuthToken(OAuthToken instance); + #endregion + + public DataClassesDataContext() : + base(global::System.Configuration.ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString, mappingSource) + { + OnCreated(); + } + + public DataClassesDataContext(string connection) : + base(connection, mappingSource) + { + OnCreated(); + } + + public DataClassesDataContext(System.Data.IDbConnection connection) : + base(connection, mappingSource) + { + OnCreated(); + } + + public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : + base(connection, mappingSource) + { + OnCreated(); + } + + public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : + base(connection, mappingSource) + { + OnCreated(); + } + + public System.Data.Linq.Table<User> Users + { + get + { + return this.GetTable<User>(); + } + } + + public System.Data.Linq.Table<FavoriteSite> FavoriteSites + { + get + { + return this.GetTable<FavoriteSite>(); + } + } + + public System.Data.Linq.Table<OAuthConsumer> OAuthConsumers + { + get + { + return this.GetTable<OAuthConsumer>(); + } + } + + public System.Data.Linq.Table<OAuthToken> OAuthTokens + { + get + { + return this.GetTable<OAuthToken>(); + } + } +} + +[Table(Name="dbo.[User]")] +public partial class User : INotifyPropertyChanging, INotifyPropertyChanged +{ + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _UserId; + + private string _OpenIDClaimedIdentifier; + + private string _OpenIDFriendlyIdentifier; + + private string _FullName; + + private System.Nullable<int> _Age; + + private EntitySet<FavoriteSite> _FavoriteSites; + + private EntitySet<OAuthToken> _OAuthTokens; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnUserIdChanging(int value); + partial void OnUserIdChanged(); + partial void OnOpenIDClaimedIdentifierChanging(string value); + partial void OnOpenIDClaimedIdentifierChanged(); + partial void OnOpenIDFriendlyIdentifierChanging(string value); + partial void OnOpenIDFriendlyIdentifierChanged(); + partial void OnFullNameChanging(string value); + partial void OnFullNameChanged(); + partial void OnAgeChanging(System.Nullable<int> value); + partial void OnAgeChanged(); + #endregion + + public User() + { + this._FavoriteSites = new EntitySet<FavoriteSite>(new Action<FavoriteSite>(this.attach_FavoriteSites), new Action<FavoriteSite>(this.detach_FavoriteSites)); + this._OAuthTokens = new EntitySet<OAuthToken>(new Action<OAuthToken>(this.attach_OAuthTokens), new Action<OAuthToken>(this.detach_OAuthTokens)); + OnCreated(); + } + + [Column(Storage="_UserId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int UserId + { + get + { + return this._UserId; + } + set + { + if ((this._UserId != value)) + { + this.OnUserIdChanging(value); + this.SendPropertyChanging(); + this._UserId = value; + this.SendPropertyChanged("UserId"); + this.OnUserIdChanged(); + } + } + } + + [Column(Storage="_OpenIDClaimedIdentifier", DbType="NVarChar(150) NOT NULL", CanBeNull=false)] + public string OpenIDClaimedIdentifier + { + get + { + return this._OpenIDClaimedIdentifier; + } + set + { + if ((this._OpenIDClaimedIdentifier != value)) + { + this.OnOpenIDClaimedIdentifierChanging(value); + this.SendPropertyChanging(); + this._OpenIDClaimedIdentifier = value; + this.SendPropertyChanged("OpenIDClaimedIdentifier"); + this.OnOpenIDClaimedIdentifierChanged(); + } + } + } + + [Column(Storage="_OpenIDFriendlyIdentifier", DbType="NVarChar(150)")] + public string OpenIDFriendlyIdentifier + { + get + { + return this._OpenIDFriendlyIdentifier; + } + set + { + if ((this._OpenIDFriendlyIdentifier != value)) + { + this.OnOpenIDFriendlyIdentifierChanging(value); + this.SendPropertyChanging(); + this._OpenIDFriendlyIdentifier = value; + this.SendPropertyChanged("OpenIDFriendlyIdentifier"); + this.OnOpenIDFriendlyIdentifierChanged(); + } + } + } + + [Column(Storage="_FullName", DbType="NVarChar(150)", CanBeNull=false)] + public string FullName + { + get + { + return this._FullName; + } + set + { + if ((this._FullName != value)) + { + this.OnFullNameChanging(value); + this.SendPropertyChanging(); + this._FullName = value; + this.SendPropertyChanged("FullName"); + this.OnFullNameChanged(); + } + } + } + + [Column(Storage="_Age", DbType="int")] + public System.Nullable<int> Age + { + get + { + return this._Age; + } + set + { + if ((this._Age != value)) + { + this.OnAgeChanging(value); + this.SendPropertyChanging(); + this._Age = value; + this.SendPropertyChanged("Age"); + this.OnAgeChanged(); + } + } + } + + [Association(Name="User_FavoriteSite", Storage="_FavoriteSites", ThisKey="UserId", OtherKey="UserId")] + public EntitySet<FavoriteSite> FavoriteSites + { + get + { + return this._FavoriteSites; + } + set + { + this._FavoriteSites.Assign(value); + } + } + + [Association(Name="User_OAuthToken", Storage="_OAuthTokens", ThisKey="UserId", OtherKey="UserId")] + public EntitySet<OAuthToken> OAuthTokens + { + get + { + return this._OAuthTokens; + } + set + { + this._OAuthTokens.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_FavoriteSites(FavoriteSite entity) + { + this.SendPropertyChanging(); + entity.User = this; + } + + private void detach_FavoriteSites(FavoriteSite entity) + { + this.SendPropertyChanging(); + entity.User = null; + } + + private void attach_OAuthTokens(OAuthToken entity) + { + this.SendPropertyChanging(); + entity.User = this; + } + + private void detach_OAuthTokens(OAuthToken entity) + { + this.SendPropertyChanging(); + entity.User = null; + } +} + +[Table(Name="dbo.FavoriteSite")] +public partial class FavoriteSite : INotifyPropertyChanging, INotifyPropertyChanged +{ + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _FavoriteSiteId; + + private int _UserId; + + private string _SiteUrl; + + private EntityRef<User> _User; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnFavoriteSiteIdChanging(int value); + partial void OnFavoriteSiteIdChanged(); + partial void OnUserIdChanging(int value); + partial void OnUserIdChanged(); + partial void OnSiteUrlChanging(string value); + partial void OnSiteUrlChanged(); + #endregion + + public FavoriteSite() + { + this._User = default(EntityRef<User>); + OnCreated(); + } + + [Column(Storage="_FavoriteSiteId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int FavoriteSiteId + { + get + { + return this._FavoriteSiteId; + } + set + { + if ((this._FavoriteSiteId != value)) + { + this.OnFavoriteSiteIdChanging(value); + this.SendPropertyChanging(); + this._FavoriteSiteId = value; + this.SendPropertyChanged("FavoriteSiteId"); + this.OnFavoriteSiteIdChanged(); + } + } + } + + [Column(Storage="_UserId", DbType="Int NOT NULL")] + public int UserId + { + get + { + return this._UserId; + } + set + { + if ((this._UserId != value)) + { + if (this._User.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnUserIdChanging(value); + this.SendPropertyChanging(); + this._UserId = value; + this.SendPropertyChanged("UserId"); + this.OnUserIdChanged(); + } + } + } + + [Column(Storage="_SiteUrl", DbType="NVarChar(255) NOT NULL", CanBeNull=false)] + public string SiteUrl + { + get + { + return this._SiteUrl; + } + set + { + if ((this._SiteUrl != value)) + { + this.OnSiteUrlChanging(value); + this.SendPropertyChanging(); + this._SiteUrl = value; + this.SendPropertyChanged("SiteUrl"); + this.OnSiteUrlChanged(); + } + } + } + + [Association(Name="User_FavoriteSite", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] + public User User + { + get + { + return this._User.Entity; + } + set + { + User previousValue = this._User.Entity; + if (((previousValue != value) + || (this._User.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._User.Entity = null; + previousValue.FavoriteSites.Remove(this); + } + this._User.Entity = value; + if ((value != null)) + { + value.FavoriteSites.Add(this); + this._UserId = value.UserId; + } + else + { + this._UserId = default(int); + } + this.SendPropertyChanged("User"); + } + } + } + + 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)); + } + } +} + +[Table(Name="dbo.OAuthConsumer")] +public partial class OAuthConsumer : INotifyPropertyChanging, INotifyPropertyChanged +{ + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _ConsumerId; + + private string _ConsumerKey; + + private string _ConsumerSecret; + + private EntitySet<OAuthToken> _OAuthTokens; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConsumerIdChanging(int value); + partial void OnConsumerIdChanged(); + partial void OnConsumerKeyChanging(string value); + partial void OnConsumerKeyChanged(); + partial void OnConsumerSecretChanging(string value); + partial void OnConsumerSecretChanged(); + #endregion + + public OAuthConsumer() + { + this._OAuthTokens = new EntitySet<OAuthToken>(new Action<OAuthToken>(this.attach_OAuthTokens), new Action<OAuthToken>(this.detach_OAuthTokens)); + OnCreated(); + } + + [Column(Storage="_ConsumerId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int ConsumerId + { + get + { + return this._ConsumerId; + } + set + { + if ((this._ConsumerId != value)) + { + this.OnConsumerIdChanging(value); + this.SendPropertyChanging(); + this._ConsumerId = value; + this.SendPropertyChanged("ConsumerId"); + this.OnConsumerIdChanged(); + } + } + } + + [Column(Storage="_ConsumerKey", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ConsumerKey + { + get + { + return this._ConsumerKey; + } + set + { + if ((this._ConsumerKey != value)) + { + this.OnConsumerKeyChanging(value); + this.SendPropertyChanging(); + this._ConsumerKey = value; + this.SendPropertyChanged("ConsumerKey"); + this.OnConsumerKeyChanged(); + } + } + } + + [Column(Storage="_ConsumerSecret", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ConsumerSecret + { + get + { + return this._ConsumerSecret; + } + set + { + if ((this._ConsumerSecret != value)) + { + this.OnConsumerSecretChanging(value); + this.SendPropertyChanging(); + this._ConsumerSecret = value; + this.SendPropertyChanged("ConsumerSecret"); + this.OnConsumerSecretChanged(); + } + } + } + + [Association(Name="OAuthConsumer_OAuthToken", Storage="_OAuthTokens", ThisKey="ConsumerId", OtherKey="ConsumerId")] + public EntitySet<OAuthToken> OAuthTokens + { + get + { + return this._OAuthTokens; + } + set + { + this._OAuthTokens.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_OAuthTokens(OAuthToken entity) + { + this.SendPropertyChanging(); + entity.OAuthConsumer = this; + } + + private void detach_OAuthTokens(OAuthToken entity) + { + this.SendPropertyChanging(); + entity.OAuthConsumer = null; + } +} + +[Table(Name="dbo.OAuthToken")] +public partial class OAuthToken : INotifyPropertyChanging, INotifyPropertyChanged +{ + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _TokenId; + + private string _Token; + + private string _TokenSecret; + + private TokenAuthorizationState _State; + + private System.DateTime _IssueDate; + + private int _ConsumerId; + + private System.Nullable<int> _UserId; + + private string _Scope; + + private EntityRef<OAuthConsumer> _OAuthConsumer; + + private EntityRef<User> _User; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnTokenIdChanging(int value); + partial void OnTokenIdChanged(); + partial void OnTokenChanging(string value); + partial void OnTokenChanged(); + partial void OnTokenSecretChanging(string value); + partial void OnTokenSecretChanged(); + partial void OnStateChanging(TokenAuthorizationState value); + partial void OnStateChanged(); + partial void OnIssueDateChanging(System.DateTime value); + partial void OnIssueDateChanged(); + partial void OnConsumerIdChanging(int value); + partial void OnConsumerIdChanged(); + partial void OnUserIdChanging(System.Nullable<int> value); + partial void OnUserIdChanged(); + partial void OnScopeChanging(string value); + partial void OnScopeChanged(); + #endregion + + public OAuthToken() + { + this._OAuthConsumer = default(EntityRef<OAuthConsumer>); + this._User = default(EntityRef<User>); + OnCreated(); + } + + [Column(Storage="_TokenId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int TokenId + { + get + { + return this._TokenId; + } + set + { + if ((this._TokenId != value)) + { + this.OnTokenIdChanging(value); + this.SendPropertyChanging(); + this._TokenId = value; + this.SendPropertyChanged("TokenId"); + this.OnTokenIdChanged(); + } + } + } + + [Column(Storage="_Token", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string Token + { + get + { + return this._Token; + } + set + { + if ((this._Token != value)) + { + this.OnTokenChanging(value); + this.SendPropertyChanging(); + this._Token = value; + this.SendPropertyChanged("Token"); + this.OnTokenChanged(); + } + } + } + + [Column(Storage="_TokenSecret", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string TokenSecret + { + get + { + return this._TokenSecret; + } + set + { + if ((this._TokenSecret != value)) + { + this.OnTokenSecretChanging(value); + this.SendPropertyChanging(); + this._TokenSecret = value; + this.SendPropertyChanged("TokenSecret"); + this.OnTokenSecretChanged(); + } + } + } + + [Column(Storage="_State", DbType="Int NOT NULL", CanBeNull=false)] + public TokenAuthorizationState State + { + get + { + return this._State; + } + set + { + if ((this._State != value)) + { + this.OnStateChanging(value); + this.SendPropertyChanging(); + this._State = value; + this.SendPropertyChanged("State"); + this.OnStateChanged(); + } + } + } + + [Column(Storage="_IssueDate", DbType="DateTime NOT NULL")] + public System.DateTime IssueDate + { + get + { + return this._IssueDate; + } + set + { + if ((this._IssueDate != value)) + { + this.OnIssueDateChanging(value); + this.SendPropertyChanging(); + this._IssueDate = value; + this.SendPropertyChanged("IssueDate"); + this.OnIssueDateChanged(); + } + } + } + + [Column(Storage="_ConsumerId", DbType="Int NOT NULL")] + public int ConsumerId + { + get + { + return this._ConsumerId; + } + set + { + if ((this._ConsumerId != value)) + { + if (this._OAuthConsumer.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnConsumerIdChanging(value); + this.SendPropertyChanging(); + this._ConsumerId = value; + this.SendPropertyChanged("ConsumerId"); + this.OnConsumerIdChanged(); + } + } + } + + [Column(Storage="_UserId", DbType="Int")] + public System.Nullable<int> UserId + { + get + { + return this._UserId; + } + set + { + if ((this._UserId != value)) + { + if (this._User.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnUserIdChanging(value); + this.SendPropertyChanging(); + this._UserId = value; + this.SendPropertyChanged("UserId"); + this.OnUserIdChanged(); + } + } + } + + [Column(Storage="_Scope", DbType="nvarchar(MAX)", CanBeNull=false)] + public string Scope + { + get + { + return this._Scope; + } + set + { + if ((this._Scope != value)) + { + this.OnScopeChanging(value); + this.SendPropertyChanging(); + this._Scope = value; + this.SendPropertyChanged("Scope"); + this.OnScopeChanged(); + } + } + } + + [Association(Name="OAuthConsumer_OAuthToken", Storage="_OAuthConsumer", ThisKey="ConsumerId", OtherKey="ConsumerId", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] + public OAuthConsumer OAuthConsumer + { + get + { + return this._OAuthConsumer.Entity; + } + set + { + OAuthConsumer previousValue = this._OAuthConsumer.Entity; + if (((previousValue != value) + || (this._OAuthConsumer.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._OAuthConsumer.Entity = null; + previousValue.OAuthTokens.Remove(this); + } + this._OAuthConsumer.Entity = value; + if ((value != null)) + { + value.OAuthTokens.Add(this); + this._ConsumerId = value.ConsumerId; + } + else + { + this._ConsumerId = default(int); + } + this.SendPropertyChanged("OAuthConsumer"); + } + } + } + + [Association(Name="User_OAuthToken", Storage="_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true, DeleteRule="CASCADE")] + public User User + { + get + { + return this._User.Entity; + } + set + { + User previousValue = this._User.Entity; + if (((previousValue != value) + || (this._User.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._User.Entity = null; + previousValue.OAuthTokens.Remove(this); + } + this._User.Entity = value; + if ((value != null)) + { + value.OAuthTokens.Add(this); + this._UserId = value.UserId; + } + else + { + this._UserId = default(Nullable<int>); + } + this.SendPropertyChanged("User"); + } + } + } + + 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 diff --git a/samples/ServiceProvider/App_Code/IDataApi.cs b/samples/ServiceProvider/App_Code/IDataApi.cs index ce9dafe..350df35 100644 --- a/samples/ServiceProvider/App_Code/IDataApi.cs +++ b/samples/ServiceProvider/App_Code/IDataApi.cs @@ -1,18 +1,18 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.ServiceModel;
-using System.Text;
-
-[ServiceContract]
-public interface IDataApi {
- [OperationContract]
- int? GetAge();
-
- [OperationContract]
- string GetName();
-
- [OperationContract]
- string[] GetFavoriteSites();
-}
+using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.Text; + +[ServiceContract] +public interface IDataApi { + [OperationContract] + int? GetAge(); + + [OperationContract] + string GetName(); + + [OperationContract] + string[] GetFavoriteSites(); +} diff --git a/samples/ServiceProvider/App_Code/TokenAuthorizationState.cs b/samples/ServiceProvider/App_Code/TokenAuthorizationState.cs index ff93684..8d3c8ac 100644 --- a/samples/ServiceProvider/App_Code/TokenAuthorizationState.cs +++ b/samples/ServiceProvider/App_Code/TokenAuthorizationState.cs @@ -1,24 +1,24 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-
-/// <summary>
-/// Various states an OAuth token can be in.
-/// </summary>
-public enum TokenAuthorizationState : int {
- /// <summary>
- /// An unauthorized request token.
- /// </summary>
- UnauthorizedRequestToken = 0,
-
- /// <summary>
- /// An authorized request token.
- /// </summary>
- AuthorizedRequestToken = 1,
-
- /// <summary>
- /// An authorized access token.
- /// </summary>
- AccessToken = 2,
-}
+using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +/// <summary> +/// Various states an OAuth token can be in. +/// </summary> +public enum TokenAuthorizationState : int { + /// <summary> + /// An unauthorized request token. + /// </summary> + UnauthorizedRequestToken = 0, + + /// <summary> + /// An authorized request token. + /// </summary> + AuthorizedRequestToken = 1, + + /// <summary> + /// An authorized access token. + /// </summary> + AccessToken = 2, +} diff --git a/samples/ServiceProvider/App_Code/TracePageAppender.cs b/samples/ServiceProvider/App_Code/TracePageAppender.cs index 9f536cd..7490f3d 100644 --- a/samples/ServiceProvider/App_Code/TracePageAppender.cs +++ b/samples/ServiceProvider/App_Code/TracePageAppender.cs @@ -1,11 +1,11 @@ -using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Web;
-
-public class TracePageAppender : log4net.Appender.AppenderSkeleton {
- protected override void Append(log4net.Core.LoggingEvent loggingEvent) {
- StringWriter sw = new StringWriter(Global.LogMessages);
- Layout.Format(sw, loggingEvent);
- }
-}
+using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +public class TracePageAppender : log4net.Appender.AppenderSkeleton { + protected override void Append(log4net.Core.LoggingEvent loggingEvent) { + StringWriter sw = new StringWriter(Global.LogMessages); + Layout.Format(sw, loggingEvent); + } +} diff --git a/samples/ServiceProvider/Members/AuthorizedConsumers.aspx.cs b/samples/ServiceProvider/Members/AuthorizedConsumers.aspx.cs index 1fb4e95..e7af629 100644 --- a/samples/ServiceProvider/Members/AuthorizedConsumers.aspx.cs +++ b/samples/ServiceProvider/Members/AuthorizedConsumers.aspx.cs @@ -1,15 +1,15 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-/// <summary>
-/// Lists the consumers that have active request or access tokens
-/// and provides a mechanism for the user to revoke permissions.
-/// </summary>
-public partial class AuthorizedConsumers : System.Web.UI.Page {
- protected void Page_Load(object sender, EventArgs e) {
- }
-}
+using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +/// <summary> +/// Lists the consumers that have active request or access tokens +/// and provides a mechanism for the user to revoke permissions. +/// </summary> +public partial class AuthorizedConsumers : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + } +} diff --git a/samples/ServiceProvider/TracePage.aspx.cs b/samples/ServiceProvider/TracePage.aspx.cs index d1b0231..6f259a7 100644 --- a/samples/ServiceProvider/TracePage.aspx.cs +++ b/samples/ServiceProvider/TracePage.aspx.cs @@ -1,21 +1,21 @@ -using System;
-using System.Collections.Generic;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-/// <summary>
-/// A page to display recent log messages.
-/// </summary>
-public partial class TracePage : System.Web.UI.Page {
- protected void Page_Load(object sender, EventArgs e) {
- placeHolder1.Controls.Add(new Label { Text = Global.LogMessages.ToString() });
- }
-
- protected void clearLogButton_Click(object sender, EventArgs e) {
- Global.LogMessages.Length = 0;
-
- // clear the page immediately, and allow for F5 without a Postback warning.
- Response.Redirect(Request.Url.AbsoluteUri);
- }
-}
+using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +/// <summary> +/// A page to display recent log messages. +/// </summary> +public partial class TracePage : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + placeHolder1.Controls.Add(new Label { Text = Global.LogMessages.ToString() }); + } + + protected void clearLogButton_Click(object sender, EventArgs e) { + Global.LogMessages.Length = 0; + + // clear the page immediately, and allow for F5 without a Postback warning. + Response.Redirect(Request.Url.AbsoluteUri); + } +} |