forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRendererFormat.cs
More file actions
157 lines (134 loc) · 5.23 KB
/
RendererFormat.cs
File metadata and controls
157 lines (134 loc) · 5.23 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
/********
* @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/.
********/
namespace Ext.Net
{
/// <summary>
/// Reusable data formatting functions
/// </summary>
public enum RendererFormat
{
/// <summary>
///
/// </summary>
None,
/// <summary>
/// Converts the first character only of a string to upper case
/// </summary>
Capitalize,
/// <summary>
/// Parse a value into a formatted date using the specified format pattern.
/// </summary>
Date,
/// <summary>
/// Returns a date rendering function that can be reused to apply a date format multiple times efficiently
/// format : String
/// (optional) Any valid date format string (defaults to 'm/d/Y')
/// </summary>
DateRenderer,
/// <summary>
/// Checks a reference and converts it to the default value if it's empty
/// </summary>
DefaultValue,
/// <summary>
/// Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length
/// defaultValue : String
/// The value to insert of it's undefined (defaults to "")
/// </summary>
Ellipsis,
/// <summary>
/// Simple format for a file size (xxx bytes, xxx KB, xxx MB)
/// length : Number
/// The maximum length to allow before truncating
/// word : Boolean
/// True to try to find a common work break
/// </summary>
FileSize,
/// <summary>
/// Convert certain characters from their HTML character equivalents.
/// </summary>
HtmlDecode,
/// <summary>
/// Convert certain characters to their HTML character equivalents for literal display in web pages.
/// </summary>
HtmlEncode,
/// <summary>
/// Converts newline characters to the HTML tag <br/>
/// </summary>
Nl2br,
/// <summary>
/// Formats the number according to the format string.
/// examples (123456.789):
/// 0 - (123456) show only digits, no precision
/// 0.00 - (123456.78) show only digits, 2 precision
/// 0.0000 - (123456.7890) show only digits, 4 precision
/// 0,000 - (123,456) show comma and digits, no precision
/// 0,000.00 - (123,456.78) show comma and digits, 2 precision
/// 0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
/// To reverse the grouping (,) and decimal (.) for international numbers, add /i to the end. For example: 0.000,00/i
/// </summary>
Number,
/// <summary>
/// Returns a number rendering function that can be reused to apply a number format multiple times efficiently
/// </summary>
NumberRenderer,
/// <summary>
/// Converts a string to all lower case letters
/// </summary>
Lowercase,
/// <summary>
/// Selectively do a plural form of a word based on a numeric value. For example, in a template, {commentCount:plural("Comment")} would result in "1 Comment" if commentCount was 1 or would be "x Comments" if the value is 0 or greater than 1.
/// </summary>
Plural,
/// <summary>
/// Rounds the passed number to the required decimal precision.
/// singular : String
/// The singular form of the word
/// plural : String
/// (optional) The plural form of the word (defaults to the singular with an "s")
/// </summary>
Round,
/// <summary>
/// Strips all script tags
/// precision : Number
/// The number of decimal places to which to round the first parameter's value.
/// </summary>
StripScripts,
/// <summary>
/// Strips all HTML tags
/// </summary>
StripTags,
/// <summary>
/// Returns a substring from within an original string
/// </summary>
Substr,
/// <summary>
/// Trims any whitespace from either side of a string
/// start : Number
/// The start index of the substring
/// length : Number
/// The length of the substring
/// </summary>
Trim,
/// <summary>
/// Checks a reference and converts it to empty string if it is undefined
/// </summary>
Undef,
/// <summary>
/// Converts a string to all upper case letters
/// </summary>
Uppercase,
/// <summary>
/// Format a number as US currency
/// </summary>
UsMoney,
/// <summary>
/// Format a number as Euro currency
/// </summary>
EuroMoney
}
}