@@ -253,7 +253,7 @@ protected override void OnInit(EventArgs e) {
253
253
return ;
254
254
255
255
var processor = new UploadRequestProcessor {
256
- Context = Context ,
256
+ Control = this ,
257
257
UploadStart = UploadStart ,
258
258
UploadComplete = UploadComplete ,
259
259
UploadCompleteAll = UploadCompleteAll ,
@@ -522,19 +522,19 @@ static string GetGrandParentDirectoryName(string tmpFilePath) {
522
522
}
523
523
524
524
class UploadRequestProcessor {
525
- public HttpContext Context ;
525
+ public AjaxFileUpload Control ;
526
526
527
527
public EventHandler < AjaxFileUploadStartEventArgs > UploadStart ;
528
528
public EventHandler < AjaxFileUploadEventArgs > UploadComplete ;
529
529
public EventHandler < AjaxFileUploadCompleteAllEventArgs > UploadCompleteAll ;
530
530
public Action < string > SetUploadedFilePath ;
531
531
532
532
HttpRequest Request {
533
- get { return Context . Request ; }
533
+ get { return Control . Context . Request ; }
534
534
}
535
535
536
536
HttpResponse Response {
537
- get { return Context . Response ; }
537
+ get { return Control . Context . Response ; }
538
538
}
539
539
540
540
public void ProcessRequest ( ) {
@@ -603,7 +603,7 @@ void XhrStart() {
603
603
var filesInQueue = int . Parse ( Request . QueryString [ "queue" ] ?? "0" ) ;
604
604
var args = new AjaxFileUploadStartEventArgs ( filesInQueue ) ;
605
605
if ( UploadStart != null )
606
- UploadStart ( this , args ) ;
606
+ UploadStart ( Control , args ) ;
607
607
Response . Write ( new JavaScriptSerializer ( ) . Serialize ( args ) ) ;
608
608
}
609
609
@@ -629,7 +629,7 @@ void XhrComplete() {
629
629
630
630
var args = new AjaxFileUploadCompleteAllEventArgs ( filesInQueue , filesUploaded , completeReason ) ;
631
631
if ( UploadCompleteAll != null )
632
- UploadCompleteAll ( this , args ) ;
632
+ UploadCompleteAll ( Control , args ) ;
633
633
Response . Write ( new JavaScriptSerializer ( ) . Serialize ( args ) ) ;
634
634
}
635
635
@@ -654,7 +654,7 @@ void XhrDone(string fileId) {
654
654
Path . GetExtension ( originalFilename ) ) ;
655
655
656
656
if ( UploadComplete != null )
657
- UploadComplete ( this , args ) ;
657
+ UploadComplete ( Control , args ) ;
658
658
659
659
Response . Write ( new JavaScriptSerializer ( ) . Serialize ( args ) ) ;
660
660
}
@@ -664,11 +664,11 @@ static string StripTempFileExtension(string fileName) {
664
664
}
665
665
666
666
void XhrCancel ( string fileId ) {
667
- AjaxFileUploadHelper . Abort ( Context , fileId ) ;
667
+ AjaxFileUploadHelper . Abort ( Control . Context , fileId ) ;
668
668
}
669
669
670
670
void XhrPoll ( string fileId ) {
671
- Response . Write ( ( new AjaxFileUploadStates ( Context , fileId ) ) . Percent . ToString ( ) ) ;
671
+ Response . Write ( ( new AjaxFileUploadStates ( Control . Context , fileId ) ) . Percent . ToString ( ) ) ;
672
672
}
673
673
674
674
}
0 commit comments