Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataViewManager.cs
Go to the documentation of this file.
6using System.IO;
7using System.Text;
8using System.Xml;
9
10namespace System.Data;
11
12[Designer("Microsoft.VSDesigner.Data.VS.DataViewManagerDesigner, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
14{
16
18
20
21 private readonly bool _locked;
22
23 internal int _nViews;
24
26
27 [DefaultValue(null)]
61
64
66 {
67 get
68 {
69 if (_dataSet == null)
70 {
71 return string.Empty;
72 }
74 stringBuilder.Append("<DataViewSettingCollectionString>");
75 foreach (DataTable table in _dataSet.Tables)
76 {
81 handler.AppendLiteral("<");
82 handler.AppendFormatted(table.EncodedTableName);
83 handler.AppendLiteral(" Sort=\"");
84 handler.AppendFormatted(dataViewSetting.Sort);
85 handler.AppendLiteral("\" RowFilter=\"");
86 handler.AppendFormatted(dataViewSetting.RowFilter);
87 handler.AppendLiteral("\" RowStateFilter=\"");
88 handler.AppendFormatted(dataViewSetting.RowStateFilter);
89 handler.AppendLiteral("\"/>");
90 stringBuilder2.Append(invariantCulture, ref handler);
91 }
92 stringBuilder.Append("</DataViewSettingCollectionString>");
93 return stringBuilder.ToString();
94 }
95 [RequiresUnreferencedCode("Members of types used in the RowFilter expression might be trimmed.")]
96 set
97 {
98 if (string.IsNullOrEmpty(value))
99 {
100 return;
101 }
104 xmlTextReader.Read();
105 if (xmlTextReader.Name != "DataViewSettingCollectionString")
106 {
107 throw ExceptionBuilder.SetFailed("DataViewSettingCollectionString");
108 }
109 while (xmlTextReader.Read())
110 {
111 if (xmlTextReader.NodeType == XmlNodeType.Element)
112 {
113 string tableName = XmlConvert.DecodeName(xmlTextReader.LocalName);
114 if (xmlTextReader.MoveToAttribute("Sort"))
115 {
117 }
118 if (xmlTextReader.MoveToAttribute("RowFilter"))
119 {
121 }
122 if (xmlTextReader.MoveToAttribute("RowStateFilter"))
123 {
125 }
126 }
127 }
128 }
129 }
130
132
133 object ICollection.SyncRoot => this;
134
136
137 bool IList.IsReadOnly => true;
138
139 bool IList.IsFixedSize => true;
140
141 object? IList.this[int index]
142 {
143 get
144 {
145 return _item;
146 }
147 set
148 {
150 }
151 }
152
154
156
158
160
162
164
166 {
167 get
168 {
169 throw s_notSupported;
170 }
171 }
172
174 {
175 get
176 {
177 throw s_notSupported;
178 }
179 }
180
182 {
183 get
184 {
185 throw s_notSupported;
186 }
187 }
188
189 public event ListChangedEventHandler? ListChanged;
190
192 : this(null, locked: false)
193 {
194 }
195
198 {
199 }
200
214
221
223 {
225 }
226
227 int IList.Add(object value)
228 {
230 }
231
233 {
235 }
236
237 bool IList.Contains(object value)
238 {
239 return value == _item;
240 }
241
242 int IList.IndexOf(object value)
243 {
244 if (value != _item)
245 {
246 return -1;
247 }
248 return 1;
249 }
250
251 void IList.Insert(int index, object value)
252 {
254 }
255
256 void IList.Remove(object value)
257 {
259 }
260
262 {
264 }
265
267 {
268 throw s_notSupported;
269 }
270
274
279
281 {
282 throw s_notSupported;
283 }
284
288
290 {
291 throw s_notSupported;
292 }
293
295 {
297 if (dataSet == null)
298 {
300 }
301 if (listAccessors == null || listAccessors.Length == 0)
302 {
303 return dataSet.DataSetName;
304 }
305 DataTable dataTable = dataSet.FindTable(null, listAccessors, 0);
306 if (dataTable != null)
307 {
308 return dataTable.TableName;
309 }
310 return string.Empty;
311 }
312
314 {
316 if (dataSet == null)
317 {
319 }
320 if (listAccessors == null || listAccessors.Length == 0)
321 {
323 }
324 DataTable dataTable = dataSet.FindTable(null, listAccessors, 0);
325 if (dataTable != null)
326 {
328 }
329 return new PropertyDescriptorCollection(null);
330 }
331
333 {
334 if (_dataSet == null)
335 {
337 }
338 DataView dataView = new DataView(table);
339 dataView.SetDataViewManager(this);
340 return dataView;
341 }
342
343 protected virtual void OnListChanged(ListChangedEventArgs e)
344 {
345 try
346 {
347 this.ListChanged?.Invoke(this, e);
348 }
350 {
352 }
353 }
354
355 protected virtual void TableCollectionChanged(object? sender, CollectionChangeEventArgs e)
356 {
359 }
360
366}
static bool IsCatchableExceptionType(Exception e)
Definition ADP.cs:790
DataTableCollection Tables
Definition DataSet.cs:396
PropertyDescriptorCollection GetPropertyDescriptorCollection(Attribute[] attributes)
DataViewManager(DataSet? dataSet)
DataViewSettingCollection _dataViewSettingsCollection
virtual void RelationCollectionChanged(object? sender, CollectionChangeEventArgs e)
static readonly NotSupportedException s_notSupported
DataView CreateDataView(DataTable table)
ListChangedEventHandler? ListChanged
DataViewManager(DataSet dataSet, bool locked)
DataViewSettingCollection DataViewSettings
virtual void TableCollectionChanged(object? sender, CollectionChangeEventArgs e)
virtual void OnListChanged(ListChangedEventArgs e)
readonly DataViewManagerListItemTypeDescriptor _item
static Exception SetDataSetFailed()
static Exception CanNotUseDataViewManager()
static Exception CannotModifyCollection()
static Exception SetFailed(object value, DataColumn column, Type type, Exception innerException)
static Exception CanNotSetDataSet()
static Exception TraceExceptionWithoutRethrow(Exception e)
static object Parse(Type enumType, string value)
Definition Enum.cs:368
static void SuppressFinalize(object obj)
Definition GC.cs:202
Definition GC.cs:8
static CultureInfo InvariantCulture
static ? string DecodeName(string? name)
Definition XmlConvert.cs:55
void CopyTo(Array array, int index)
void RemoveAt(int index)
void Insert(int index, object? value)
int Add(object? value)
bool Contains(object? value)
void Remove(object? value)
int IndexOf(object? value)
void AddIndex(PropertyDescriptor property)
void ApplySort(PropertyDescriptor property, ListSortDirection direction)
void RemoveIndex(PropertyDescriptor property)
int Find(PropertyDescriptor property, object key)
PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
string GetListName(PropertyDescriptor[] listAccessors)