Author: krasnov
Date: 2006-11-27 07:45:09 -0500 (Mon, 27 Nov 2006)
New Revision: 68505

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
Log:
* Wizard.cs: fixed GetStepType method that returned wrong type if the last step 
type is Complete.
fixed ProcessEvent method, corrected FinishButtonClick behavior

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-27 12:36:24 UTC (rev 68504)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-27 12:45:09 UTC (rev 68505)
@@ -1,3 +1,9 @@
+2006-11-27  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * Wizard.cs: fixed GetStepType method that returned wrong type if the
+       last step type is Complete.
+       fixed ProcessEvent method, corrected FinishButtonClick behavior
+
 2006-11-26  Marek Habersack  <[EMAIL PROTECTED]>
 
        * Calendar.cs: Fixed event validation registration. Now it

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs      
2006-11-27 12:36:24 UTC (rev 68504)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Wizard.cs      
2006-11-27 12:45:09 UTC (rev 68505)
@@ -828,7 +828,10 @@
                public WizardStepType GetStepType (WizardStepBase wizardStep, 
int index)
                {
                        if (wizardStep.StepType == WizardStepType.Auto) {
-                               if (index == WizardSteps.Count - 1)
+                               if ((index == WizardSteps.Count - 1) || 
+                                               (WizardSteps.Count > 2 && 
+                                               WizardSteps[WizardSteps.Count - 
1].StepType == WizardStepType.Complete && 
+                                               index == WizardSteps.Count - 2))
                                        return WizardStepType.Finish;
                                else if (index == 0)
                                        return WizardStepType.Start;
@@ -1300,11 +1303,6 @@
                                        break;
 
                                case "MoveComplete":
-                                       if (FinishDestinationPageUrl.Length > 
0) {
-                                               Context.Response.Redirect 
(FinishDestinationPageUrl);
-                                               return;
-                                       }
-                               
                                        int next = -1;
                                        for (int n=0; n<WizardSteps.Count; n++) 
{
                                                if (WizardSteps [n].StepType == 
WizardStepType.Complete) {
@@ -1312,12 +1310,21 @@
                                                        break;
                                                }
                                        }
-                                       if (next != -1) {
-                                               WizardNavigationEventArgs args 
= new WizardNavigationEventArgs (ActiveStepIndex, next);
-                                               OnFinishButtonClick (args);
-                                               if (!args.Cancel)
-                                                       ActiveStepIndex = next;
+
+                                       if (next == -1 && ActiveStepIndex == 
WizardSteps.Count - 1)
+                                               next = ActiveStepIndex;
+
+                                       WizardNavigationEventArgs navArgs = new 
WizardNavigationEventArgs (ActiveStepIndex, next);
+                                       OnFinishButtonClick (navArgs);
+
+                                       if (FinishDestinationPageUrl.Length > 
0) {
+                                               Context.Response.Redirect 
(FinishDestinationPageUrl);
+                                               return;
                                        }
+
+                                       if (next != -1 && !navArgs.Cancel)
+                                               ActiveStepIndex = next;
+
                                        break;
                                        
                                case "MoveNext":

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to