forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlashComponent.cs
More file actions
326 lines (300 loc) · 10.7 KB
/
FlashComponent.cs
File metadata and controls
326 lines (300 loc) · 10.7 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
/********
* @version : 2.1.1 - Ext.NET Pro License
* @author : Ext.NET, Inc. http://www.ext.net/
* @date : 2012-12-10
* @copyright : Copyright (c) 2007-2012, Ext.NET, Inc. (http://www.ext.net/). All rights reserved.
* @license : See license.txt and http://www.ext.net/license/.
********/
using System.ComponentModel;
using System.Web.UI;
using System.Drawing;
using System.Collections.Generic;
namespace Ext.Net
{
/// <summary>
/// A simple Component for displaying an Adobe Flash SWF movie. The movie will be sized and can participate in layout like any other Component.
///
/// Configuration
///
/// This component allows several options for configuring how the target Flash movie is embedded. The most important is the required url which points to the location of the Flash movie to load. Other configurations include:
///
/// backgroundColor
/// wmode
/// flashVars
/// flashParams
/// flashAttributes
/// </summary>
[Meta]
[ToolboxItem(true)]
[ToolboxBitmap(typeof(FlashComponent), "Build.ToolboxIcons.FlashComponent.bmp")]
[ToolboxData("<{0}:FlashComponent runat=\"server\"></{0}:FlashComponent>")]
[Designer(typeof(EmptyDesigner))]
[Description("A Flash AbstractComponent")]
public partial class FlashComponent : ComponentBase
{
/// <summary>
///
/// </summary>
[Description("")]
public FlashComponent() { }
/// <summary>
///
/// </summary>
[Category("0. About")]
[Description("")]
public override string XType
{
get
{
return "flash";
}
}
/// <summary>
///
/// </summary>
[Category("0. About")]
[Description("")]
public override string InstanceOf
{
get
{
return "Ext.flash.Component";
}
}
/// <summary>
///
/// </summary>
[Description("")]
protected override List<ResourceItem> Resources
{
get
{
List<ResourceItem> baseList = base.Resources;
baseList.Add(new ClientScriptItem(typeof(FlashComponent), "Ext.Net.Build.Ext.Net.extnet.swfobject.js", "/extnet/swfobject.js"));
return baseList;
}
}
/// <summary>
/// The background color of the SWF movie. Defaults to '#ffffff' (white).
/// </summary>
[Meta]
[Category("5. FlashComponent")]
[DefaultValue("#ffffff")]
[NotifyParentProperty(true)]
[Description("The background color. Defaults to '#ffffff' (white).")]
public virtual string BackgroundColor
{
get
{
return this.State.Get<string>("BackgroundColor", "#ffffff");
}
set
{
this.State.Set("BackgroundColor", value);
}
}
/// <summary>
/// True to prompt the user to install flash if not installed. Note that this uses Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FlashComponent")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("True to prompt the user to install flash if not installed. Note that this uses Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to false.")]
public virtual bool ExpressInstall
{
get
{
return this.State.Get<bool>("ExpressInstall", false);
}
set
{
this.State.Set("ExpressInstall", value);
}
}
/// <summary>
/// Indicates the version the flash content was published for. Defaults to '9.0.45'.
/// </summary>
[Meta]
[Category("5. FlashComponent")]
[DefaultValue("9.0.45")]
[Description("Indicates the version the flash content was published for. Defaults to '9.0.45'.")]
public virtual string FlashVersion
{
get
{
return this.State.Get<string>("FlashVersion", "9.0.45");
}
set
{
this.State.Set("FlashVersion", value);
}
}
/// <summary>
/// The URL of the swf object to include. Defaults to undefined.
/// </summary>
[Meta]
[ConfigOption(JsonMode.Url)]
[Category("5. FlashComponent")]
[DefaultValue("")]
[Description("The URL of the swf object to include. Defaults to undefined.")]
public virtual string Url
{
get
{
return this.State.Get<string>("Url", "");
}
set
{
this.State.Set("Url", value);
}
}
private ParameterCollection flashVars;
/// <summary>
/// A set of key value pairs to be passed to the flash object as flash variables.
/// </summary>
[Meta]
[Category("5. FlashComponent")]
[ConfigOption(JsonMode.ArrayToObject)]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("A set of key value pairs to be passed to the flash object as flash variables.")]
public virtual ParameterCollection FlashVars
{
get
{
if (this.flashVars == null)
{
this.flashVars = new ParameterCollection();
this.flashVars.Owner = this;
}
return this.flashVars;
}
}
private ParameterCollection flashParams;
/// <summary>
/// A set of key value pairs to be passed to the flash object as parameters.
/// Possible parameters can be found here: http://kb2.adobe.com/cps/127/tn_12701.html
/// </summary>
[Meta]
[Category("5. FlashComponent")]
[ConfigOption(JsonMode.ArrayToObject)]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("A set of key value pairs to be passed to the flash object as parameters.")]
public virtual ParameterCollection FlashParams
{
get
{
if (this.flashParams == null)
{
this.flashParams = new ParameterCollection();
this.flashParams.Owner = this;
}
return this.flashParams;
}
}
/// <summary>
/// The height of the embedded SWF movie inside the component. Defaults to "100%" so that the movie matches the height of the component.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FlashComponent")]
[DefaultValue("")]
[Description("The height of the embedded SWF movie inside the component. Defaults to \"100%\" so that the movie matches the height of the component.")]
public virtual string SwfHeight
{
get
{
return this.State.Get<string>("SwfHeight", "");
}
set
{
this.State.Set("SwfHeight", value);
}
}
/// <summary>
/// The width of the embedded SWF movie inside the component. Defaults to "100%" so that the movie matches the width of the component.
/// </summary>
[Meta]
[ConfigOption]
[Category("5. FlashComponent")]
[DefaultValue("")]
[Description("The width of the embedded SWF movie inside the component. Defaults to \"100%\" so that the movie matches the width of the component.")]
public virtual string SwfWidth
{
get
{
return this.State.Get<string>("SwfWidth", "");
}
set
{
this.State.Set("SwfWidth", value);
}
}
/// <summary>
/// The wmode of the flash object. This can be used to control layering. Set to 'transparent' to ignore the backgroundColor and make the background of the Flash movie transparent.
/// </summary>
[Meta]
[ConfigOption("wmode")]
[Category("5. FlashComponent")]
[DefaultValue("")]
[Description("The wmode of the flash object. This can be used to control layering. Set to 'transparent' to ignore the backgroundColor and make the background of the Flash movie transparent.")]
public virtual string WMode
{
get
{
return this.State.Get<string>("WMode", "");
}
set
{
this.State.Set("WMode", value);
}
}
private FlashComponentListeners listeners;
/// <summary>
/// Client-side JavaScript Event Handlers
/// </summary>
[Meta]
[ConfigOption("listeners", JsonMode.Object)]
[Category("2. Observable")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Description("Client-side JavaScript Event Handlers")]
public FlashComponentListeners Listeners
{
get
{
if (this.listeners == null)
{
this.listeners = new FlashComponentListeners();
}
return this.listeners;
}
}
private FlashComponentDirectEvents directEvents;
/// <summary>
/// Server-side Ajax Event Handlers
/// </summary>
[Meta]
[Category("2. Observable")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[ConfigOption("directEvents", JsonMode.Object)]
[Description("Server-side Ajax Event Handlers")]
public FlashComponentDirectEvents DirectEvents
{
get
{
if (this.directEvents == null)
{
this.directEvents = new FlashComponentDirectEvents(this);
}
return this.directEvents;
}
}
}
}