-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathModAccountBase.as
More file actions
137 lines (110 loc) · 3.6 KB
/
Copy pathModAccountBase.as
File metadata and controls
137 lines (110 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Copyright 2011 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
import containers.CoreDialog;
import containers.ResizingDialog;
import dialogs.*;
import dialogs.Purchase.*;
import dialogs.Upsell.*;
import module.PicnikModule;
import mx.core.UIComponent;
import mx.managers.PopUpManager;
public class ModAccountBase extends PicnikModule {
[Bindable] public var myAccount:MyAccount = null;
public function GetActivatableChild( id:String ):IActivatable {
if ("myAccount" == id) {
if (!myAccount) {
myAccount = new MyAccount();
myAccount.id = "myAccount";
myAccount.includeInLayout = false;
myAccount.visible = false;
this.addChild(myAccount);
}
return myAccount;
}
return null;
}
public function Show(strDialog:String, uicParent:UIComponent=null, fnComplete:Function=null, obParams:Object=null): DialogHandle {
var dlg:Object = null;
var dialogHandle:DialogHandle = new DialogHandle(strDialog, uicParent, fnComplete, obParams);
switch (strDialog) {
case "CancelPaypalDialog":
dlg = new CancelPaypalDialog();
break;
case "ChangeEmailDialog":
dlg = new ChangeEmailDialog();
break;
case "ChangePasswordDialog":
dlg = new ChangePasswordDialog();
break;
case "ChangePerformanceDialog":
dlg = new ChangePerformanceDialog();
break;
case "ConfirmCancelDialog":
dlg = new ConfirmCancelDialog();
break;
case "ConfirmDelAcctDialog":
dlg = new ConfirmDelAcctDialog();
break;
case "GiftPrintEmailDialog":
dlg = new GiftPrintEmailDialog();
break;
case "GiftRedeemDialog":
dlg = new GiftRedeemDialog();
break;
case "GiftUpsellDialog":
dlg = new GiftUpsellDialog();
break;
case "PurchaseDialog":
dlg = new PurchaseDialog();
break;
case "PurchaseGiftDialog":
dlg = new PurchaseGiftDialog();
break;
case "ReceiptDialog":
dlg = new ReceiptDialog();
break;
case "SettingsDialog":
dlg = new SettingsDialog();
break;
case "TargetedUpsellDialog":
dlg = new TargetedUpsellDialog();
break;
default:
Debug.Assert(false, "Requesting unknown dialog " + strDialog);
break;
}
// figure out what kind of dialog we have and act appropriately
var coreDialog:CoreDialog = dlg as CoreDialog;
if (null != coreDialog) {
if (uicParent == null) uicParent = PicnikBase.app;
coreDialog.Constructor(fnComplete, uicParent, obParams);
PopUpManager.addPopUp(coreDialog, uicParent, true);
PopUpManager.centerPopUp(coreDialog);
coreDialog.PostDisplay();
}
var resizingDialog:ResizingDialog = dlg as ResizingDialog;
if (null != resizingDialog) {
if (uicParent == null) uicParent = PicnikBase.app;
resizingDialog.Constructor(fnComplete, uicParent, obParams);
ResizingDialog.Show(resizingDialog, uicParent);
}
if (null != dlg) {
dialogHandle.IsLoaded = true;
dialogHandle.dialog = dlg;
}
return dialogHandle;
}
}
}