From 2ece9a8b0cd1aca46617ec23f8a3bf1dac4d7164 Mon Sep 17 00:00:00 2001 From: "contactamit.sharma@gmail.com" Date: Thu, 27 Feb 2014 13:45:00 -0800 Subject: [PATCH 1/3] Added State method to IDeferred interface introduced in jQuery 1.7 --- src/Libraries/jQuery/jQuery.Core/IDeferred.cs | 10 ++++++++++ .../jQuery/jQuery.Core/jQueryDeferred.cs | 15 ++++++++++++++- .../jQuery/jQuery.Core/jQueryXmlHttpRequest.cs | 8 +++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/Libraries/jQuery/jQuery.Core/IDeferred.cs b/src/Libraries/jQuery/jQuery.Core/IDeferred.cs index 2485026a5..850deb690 100644 --- a/src/Libraries/jQuery/jQuery.Core/IDeferred.cs +++ b/src/Libraries/jQuery/jQuery.Core/IDeferred.cs @@ -75,6 +75,16 @@ public interface IDeferred { /// true if it has been resolved; false otherwise. bool IsResolved(); + /// + /// Determines whether the deferred object has been rejected. + /// + /// + /// "pending": The Deferred object is not yet in a completed state (neither "rejected" nor "resolved"). + ///"resolved": The Deferred object is in the resolved state, meaning that either deferred.resolve() or deferred.resolveWith() has been called for the object and the doneCallbacks have been called (or are in the process of being called). + ///"rejected": The Deferred object is in the rejected state, meaning that either deferred.reject() or deferred.rejectWith() has been called for the object and the failCallbacks have been called (or are in the process of being called). + /// + string State(); + /// /// Filters or chains deffered objects. /// diff --git a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs index d7695798c..a2941fec3 100644 --- a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs +++ b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs @@ -87,13 +87,26 @@ public bool IsRejected() { } /// - /// Determines whether the deferred object has been resolved. + /// Determine the current state of a Deferred object. /// /// true if it has been resolved; false otherwise. public bool IsResolved() { return false; } + /// + /// Determines whether the deferred object has been rejected. + /// + /// + /// "pending": The Deferred object is not yet in a completed state (neither "rejected" nor "resolved"). + ///"resolved": The Deferred object is in the resolved state, meaning that either deferred.resolve() or deferred.resolveWith() has been called for the object and the doneCallbacks have been called (or are in the process of being called). + ///"rejected": The Deferred object is in the rejected state, meaning that either deferred.reject() or deferred.rejectWith() has been called for the object and the failCallbacks have been called (or are in the process of being called). + /// + public string State() + { + return null; + } + /// /// Returns a deferred object that can be further composed. /// diff --git a/src/Libraries/jQuery/jQuery.Core/jQueryXmlHttpRequest.cs b/src/Libraries/jQuery/jQuery.Core/jQueryXmlHttpRequest.cs index 322622d44..52ad38d32 100644 --- a/src/Libraries/jQuery/jQuery.Core/jQueryXmlHttpRequest.cs +++ b/src/Libraries/jQuery/jQuery.Core/jQueryXmlHttpRequest.cs @@ -300,7 +300,13 @@ bool IDeferred.IsResolved() { return false; } - IDeferred IDeferred.Pipe(jQueryDeferredFilter successFilter) { + public string State() + { + return null; + } + + IDeferred IDeferred.Pipe(jQueryDeferredFilter successFilter) + { return null; } From 66f9c3a5edbc150643bfe7b95e251316e464e66e Mon Sep 17 00:00:00 2001 From: "contactamit.sharma@gmail.com" Date: Thu, 27 Feb 2014 13:55:31 -0800 Subject: [PATCH 2/3] Fix the comments --- src/Libraries/jQuery/jQuery.Core/IDeferred.cs | 2 +- src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Libraries/jQuery/jQuery.Core/IDeferred.cs b/src/Libraries/jQuery/jQuery.Core/IDeferred.cs index 850deb690..3ceaa454d 100644 --- a/src/Libraries/jQuery/jQuery.Core/IDeferred.cs +++ b/src/Libraries/jQuery/jQuery.Core/IDeferred.cs @@ -76,7 +76,7 @@ public interface IDeferred { bool IsResolved(); /// - /// Determines whether the deferred object has been rejected. + /// Determine the current state of a Deferred object. /// /// /// "pending": The Deferred object is not yet in a completed state (neither "rejected" nor "resolved"). diff --git a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs index a2941fec3..380b65c6a 100644 --- a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs +++ b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs @@ -87,7 +87,7 @@ public bool IsRejected() { } /// - /// Determine the current state of a Deferred object. + /// Determines whether the deferred object has been resolved. /// /// true if it has been resolved; false otherwise. public bool IsResolved() { From cb3b9bd27c394dfe10a30419e06b0b475e03f4fa Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Thu, 27 Feb 2014 13:59:54 -0800 Subject: [PATCH 3/3] Fixed the comments --- src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs index 380b65c6a..05058fece 100644 --- a/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs +++ b/src/Libraries/jQuery/jQuery.Core/jQueryDeferred.cs @@ -95,7 +95,7 @@ public bool IsResolved() { } /// - /// Determines whether the deferred object has been rejected. + /// Determine the current state of a Deferred object. /// /// /// "pending": The Deferred object is not yet in a completed state (neither "rejected" nor "resolved").