-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPropertyTypes.cs
192 lines (179 loc) · 5.32 KB
/
PropertyTypes.cs
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
// Copyright (c) 2020, Dijji, and released under Ms-PL. This, with other relevant licenses, can be found in the root of this distribution.
using System.Runtime.InteropServices;
namespace CustomWindowsProperties
{
public enum PropertyTypes
{
Any,
Null,
String,
Boolean,
Byte,
Buffer,
Int16,
UInt16,
Int32,
UInt32,
Int64,
UInt64,
Double,
DateTime,
Guid,
Blob,
Stream,
Clipboard,
Object,
}
public enum ColumnIndexType
{
NotIndexed = 0,
OnDisk = 1,
//InMemory = 2, // Obsolete
OnDemand = 3,
OnDiskAll = 4,
OnDiskVector = 5,
}
public enum ConditionOperationConfigured
{
Equal = 1,
NotEqual = 2,
LessThan = 3,
GreaterThan = 4,
Contains = 5,
}
public enum EditControl
{
Default,
Calendar,
CheckboxDropList,
DropList,
MultiLineText,
MultiValueText,
Rating,
Text,
IconList,
}
public enum PropertyAlignmentType
{
Left,
Center,
Right,
}
public enum SortDirection
{
Ascending,
Descending,
}
public enum StringFormat
{
General,
FileName,
FilePath,
Hyperlink,
}
public enum BooleanFormat
{
YesNo,
OnOff,
TrueFalse,
}
public enum NumberFormat
{
General,
Percentage,
ByteSize,
KBSize,
SampleSize,
Bitrate,
SampleRate,
FrameRate,
Pixels,
DPI,
Duration,
}
public enum DateTimeFormat
{
General,
Month,
YearMonth,
Year,
}
internal class PropertyUtils
{
/// <summary>
/// Converts VarEnum to its associated propdesc Type.
/// </summary>
/// <param name="VarEnumType">VarEnum value</param>
/// <returns>Associated .net equivelent.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
public static PropertyTypes VarEnumToPropertyType(VarEnum VarEnumType)
{
switch (VarEnumType)
{
case (VarEnum.VT_EMPTY):
case (VarEnum.VT_NULL):
return PropertyTypes.Null;
case (VarEnum.VT_UI1):
return PropertyTypes.Byte;
case (VarEnum.VT_I2):
return PropertyTypes.Int16;
case (VarEnum.VT_UI2):
return PropertyTypes.UInt16;
case (VarEnum.VT_I4):
return PropertyTypes.Int32;
case (VarEnum.VT_UI4):
return PropertyTypes.UInt32;
case (VarEnum.VT_I8):
return PropertyTypes.Int64;
case (VarEnum.VT_UI8):
return PropertyTypes.UInt64;
case (VarEnum.VT_R8):
return PropertyTypes.Double;
case (VarEnum.VT_BOOL):
return PropertyTypes.Boolean;
case (VarEnum.VT_FILETIME):
return PropertyTypes.DateTime;
case (VarEnum.VT_CLSID):
return PropertyTypes.Guid;
case (VarEnum.VT_CF):
return PropertyTypes.Clipboard;
case (VarEnum.VT_BLOB):
return PropertyTypes.Blob;
case (VarEnum.VT_LPWSTR):
return PropertyTypes.String;
case (VarEnum.VT_UNKNOWN):
return PropertyTypes.Any;
case (VarEnum.VT_STREAM):
return PropertyTypes.Stream;
case (VarEnum.VT_VECTOR | VarEnum.VT_UI1):
return PropertyTypes.Byte;
case (VarEnum.VT_VECTOR | VarEnum.VT_I2):
return PropertyTypes.Int16;
case (VarEnum.VT_VECTOR | VarEnum.VT_UI2):
return PropertyTypes.UInt16;
case (VarEnum.VT_VECTOR | VarEnum.VT_I4):
return PropertyTypes.Int32;
case (VarEnum.VT_VECTOR | VarEnum.VT_UI4):
return PropertyTypes.UInt32;
case (VarEnum.VT_VECTOR | VarEnum.VT_I8):
return PropertyTypes.Int64;
case (VarEnum.VT_VECTOR | VarEnum.VT_UI8):
return PropertyTypes.UInt64;
case (VarEnum.VT_VECTOR | VarEnum.VT_R8):
return PropertyTypes.Double;
case (VarEnum.VT_VECTOR | VarEnum.VT_BOOL):
return PropertyTypes.Boolean;
case (VarEnum.VT_VECTOR | VarEnum.VT_FILETIME):
return PropertyTypes.DateTime;
case (VarEnum.VT_VECTOR | VarEnum.VT_CLSID):
return PropertyTypes.Guid;
case (VarEnum.VT_VECTOR | VarEnum.VT_CF):
return PropertyTypes.Clipboard;
case (VarEnum.VT_VECTOR | VarEnum.VT_LPWSTR):
return PropertyTypes.String;
default:
return PropertyTypes.Object;
}
}
}
}