forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadMask.cs
More file actions
145 lines (136 loc) · 5.33 KB
/
LoadMask.cs
File metadata and controls
145 lines (136 loc) · 5.33 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
/********
* @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;
namespace Ext.Net
{
/// <summary>
/// A simple utility class for generically masking elements while loading data. If the element being masked has an underlying Ext.data.Store, the masking will be automatically synchronized with the store's loading process and the mask element will be cached for reuse. For all other elements, this mask will replace the element's UpdateOptions load indicator and will be destroyed after the initial load.
/// </summary>
[Meta]
[Description("A simple utility class for generically masking elements while loading data. If the element being masked has an underlying Ext.data.Store, the masking will be automatically synchronized with the store's loading process and the mask element will be cached for reuse. For all other elements, this mask will replace the element's UpdateOptions load indicator and will be destroyed after the initial load.")]
public partial class LoadMask : BaseItem
{
/// <summary>
///
/// </summary>
[Description("")]
public LoadMask() { }
/// <summary>
/// True to create a single-use mask that is automatically destroyed after loading (useful for page loads), False to persist the mask element reference for multiple uses (e.g., for paged data widgets). Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("Config Options")]
[DefaultValue(false)]
[Description("True to create a single-use mask that is automatically destroyed after loading (useful for page loads), False to persist the mask element reference for multiple uses (e.g., for paged data widgets). Defaults to false.")]
public virtual bool ShowMask
{
get
{
return this.State.Get<bool>("ShowMask", false);
}
set
{
this.State.Set("ShowMask", value);
}
}
/// <summary>
/// The text to display in a centered loading message box. Defaults to: "Loading..."
/// </summary>
[Meta]
[ConfigOption]
[Category("Config Options")]
[DefaultValue("Loading...")]
[Description("The text to display in a centered loading message box (defaults to 'Loading...').")]
public virtual string Msg
{
get
{
return this.State.Get<string>("Msg", "Loading...");
}
set
{
this.State.Set("Msg", value);
}
}
/// <summary>
/// The CSS class to apply to the loading message element (defaults to 'x-mask-loading').
/// </summary>
[Meta]
[ConfigOption]
[Category("Config Options")]
[DefaultValue("x-mask-loading")]
[Description("The CSS class to apply to the loading message element (defaults to 'x-mask-loading').")]
public virtual string MsgCls
{
get
{
return this.State.Get<string>("MsgCls", "x-mask-loading");
}
set
{
this.State.Set("MsgCls", value);
}
}
/// <summary>
/// Optional Store to which the mask is bound. The mask is displayed when a load request is issued, and hidden on either load success, or load fail.
/// </summary>
[Meta]
[ConfigOption("store", JsonMode.ToClientID)]
[Category("Config Options")]
[DefaultValue("")]
[IDReferenceProperty(typeof(Store))]
[Description("Optional Store to which the mask is bound. The mask is displayed when a load request is issued, and hidden on either load success, or load fail.")]
public virtual string StoreID
{
get
{
return this.State.Get<string>("StoreID", "");
}
set
{
this.State.Set("StoreID", value);
}
}
/// <summary>
/// Whether or not to use a loading message class or simply mask the bound element. Defaults to: true
/// </summary>
[Meta]
[ConfigOption]
[Category("Config Options")]
[DefaultValue(true)]
[Description("Whether or not to use a loading message class or simply mask the bound element. Defaults to: true")]
public virtual bool UseMsg
{
get
{
return this.State.Get<bool>("UseMsg", true);
}
set
{
this.State.Set("UseMsg", value);
}
}
/// <summary>
///
/// </summary>
[Description("")]
public override bool IsDefault
{
get
{
if (this is EventMask)
{
return base.IsDefault;
}
return (this.ShowMask == false);
}
}
}
}