Extended .NET SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
StringToBoolMap.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (http://www.swig.org).
5// Version 4.0.2
6//
7// Do not make changes to this file unless you know what you are doing--modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
11namespace Teigha.TD {
12
13using System;
14using System.Runtime.InteropServices;
15using Teigha.Core;
16
17public class StringToBoolMap : global::System.IDisposable
18 , global::System.Collections.Generic.IDictionary<SWIGTYPE_p_std__wstring, bool>
19 {
20 private Object locker = new Object();
21 private HandleRef swigCPtr;
22 protected bool swigCMemOwn;
23 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
24 public StringToBoolMap(IntPtr cPtr, bool cMemoryOwn) {
25 swigCMemOwn = cMemoryOwn;
26 swigCPtr = new HandleRef(this, cPtr);
27 }
28 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
29 public static HandleRef getCPtr(StringToBoolMap obj) {
30 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
31 }
32
34 Dispose(false);
35 }
36
37 public void Dispose() {
38 Dispose(true);
39 global::System.GC.SuppressFinalize(this);
40 }
41
42 protected virtual void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 }
52 }
53
54
55 public bool this[SWIGTYPE_p_std__wstring key] {
56 get {
57 return getitem(key);
58 }
59
60 set {
61 setitem(key, value);
62 }
63 }
64
65 public bool TryGetValue(SWIGTYPE_p_std__wstring key, out bool value) {
66 if (this.ContainsKey(key)) {
67 value = this[key];
68 return true;
69 }
70 value = default(bool);
71 return false;
72 }
73
74 public int Count {
75 get {
76 return (int)size();
77 }
78 }
79
80 public bool IsReadOnly {
81 get {
82 return false;
83 }
84 }
85
86 public global::System.Collections.Generic.ICollection<SWIGTYPE_p_std__wstring> Keys {
87 get {
88 global::System.Collections.Generic.ICollection<SWIGTYPE_p_std__wstring> keys = new global::System.Collections.Generic.List<SWIGTYPE_p_std__wstring>();
89 int size = this.Count;
90 if (size > 0) {
91 global::System.IntPtr iter = create_iterator_begin();
92 for (int i = 0; i < size; i++) {
93 keys.Add(get_next_key(iter));
94 }
95 destroy_iterator(iter);
96 }
97 return keys;
98 }
99 }
100
101 public global::System.Collections.Generic.ICollection<bool> Values {
102 get {
103 global::System.Collections.Generic.ICollection<bool> vals = new global::System.Collections.Generic.List<bool>();
104 foreach (global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool> pair in this) {
105 vals.Add(pair.Value);
106 }
107 return vals;
108 }
109 }
110
111 public void Add(global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool> item) {
112 Add(item.Key, item.Value);
113 }
114
115 public bool Remove(global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool> item) {
116 if (Contains(item)) {
117 return Remove(item.Key);
118 } else {
119 return false;
120 }
121 }
122
123 public bool Contains(global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool> item) {
124 if (this[item.Key] == item.Value) {
125 return true;
126 } else {
127 return false;
128 }
129 }
130
131 public void CopyTo(global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>[] array) {
132 CopyTo(array, 0);
133 }
134
135 public void CopyTo(global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>[] array, int arrayIndex) {
136 if (array == null)
137 throw new global::System.ArgumentNullException("array");
138 if (arrayIndex < 0)
139 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
140 if (array.Rank > 1)
141 throw new global::System.ArgumentException("Multi dimensional array.", "array");
142 if (arrayIndex+this.Count > array.Length)
143 throw new global::System.ArgumentException("Number of elements to copy is too large.");
144
145 global::System.Collections.Generic.IList<SWIGTYPE_p_std__wstring> keyList = new global::System.Collections.Generic.List<SWIGTYPE_p_std__wstring>(this.Keys);
146 for (int i = 0; i < keyList.Count; i++) {
147 SWIGTYPE_p_std__wstring currentKey = keyList[i];
148 array.SetValue(new global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>(currentKey, this[currentKey]), arrayIndex+i);
149 }
150 }
151
152 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>> global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>>.GetEnumerator() {
153 return new StringToBoolMapEnumerator(this);
154 }
155
156 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
157 return new StringToBoolMapEnumerator(this);
158 }
159
161 return new StringToBoolMapEnumerator(this);
162 }
163
164 // Type-safe enumerator
169 public class StringToBoolMapEnumerator : global::System.Collections.IEnumerator,
170 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>>
171 {
172 private StringToBoolMap collectionRef;
173 private global::System.Collections.Generic.IList<SWIGTYPE_p_std__wstring> keyCollection;
174 private int currentIndex;
175 private object currentObject;
176 private int currentSize;
177
179 collectionRef = collection;
180 keyCollection = new global::System.Collections.Generic.List<SWIGTYPE_p_std__wstring>(collection.Keys);
181 currentIndex = -1;
182 currentObject = null;
183 currentSize = collectionRef.Count;
184 }
185
186 // Type-safe iterator Current
187 public global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool> Current {
188 get {
189 if (currentIndex == -1)
190 throw new global::System.InvalidOperationException("Enumeration not started.");
191 if (currentIndex > currentSize - 1)
192 throw new global::System.InvalidOperationException("Enumeration finished.");
193 if (currentObject == null)
194 throw new global::System.InvalidOperationException("Collection modified.");
195 return (global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>)currentObject;
196 }
197 }
198
199 // Type-unsafe IEnumerator.Current
200 object global::System.Collections.IEnumerator.Current {
201 get {
202 return Current;
203 }
204 }
205
206 public bool MoveNext() {
207 int size = collectionRef.Count;
208 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
209 if (moveOkay) {
210 currentIndex++;
211 SWIGTYPE_p_std__wstring currentKey = keyCollection[currentIndex];
212 currentObject = new global::System.Collections.Generic.KeyValuePair<SWIGTYPE_p_std__wstring, bool>(currentKey, collectionRef[currentKey]);
213 } else {
214 currentObject = null;
215 }
216 return moveOkay;
217 }
218
219 public void Reset() {
220 currentIndex = -1;
221 currentObject = null;
222 if (collectionRef.Count != currentSize) {
223 throw new global::System.InvalidOperationException("Collection modified.");
224 }
225 }
226
227 public void Dispose() {
228 currentIndex = -1;
229 currentObject = null;
230 }
231 }
232
233
234 public StringToBoolMap() : this(TD_DbPINVOKE.new_StringToBoolMap__SWIG_0(), true) {
236 }
237
238 public StringToBoolMap(StringToBoolMap other) : this(TD_DbPINVOKE.new_StringToBoolMap__SWIG_1(StringToBoolMap.getCPtr(other)), true) {
240 }
241
242 private uint size() {
243 uint ret = TD_DbPINVOKE.StringToBoolMap_size(swigCPtr);
245 return ret;
246 }
247
248 public bool empty() {
249 bool ret = TD_DbPINVOKE.StringToBoolMap_empty(swigCPtr);
251 return ret;
252 }
253
254 public void Clear() {
257 }
258
259 private bool getitem(SWIGTYPE_p_std__wstring key) {
260 bool ret = TD_DbPINVOKE.StringToBoolMap_getitem(swigCPtr, SWIGTYPE_p_std__wstring.getCPtr(key));
262 return ret;
263 }
264
265 private void setitem(SWIGTYPE_p_std__wstring key, bool x) {
266 TD_DbPINVOKE.StringToBoolMap_setitem(swigCPtr, SWIGTYPE_p_std__wstring.getCPtr(key), x);
267 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
268 }
269
271 bool ret = TD_DbPINVOKE.StringToBoolMap_ContainsKey(swigCPtr, SWIGTYPE_p_std__wstring.getCPtr(key));
273 return ret;
274 }
275
276 public void Add(SWIGTYPE_p_std__wstring key, bool value) {
279 }
280
282 bool ret = TD_DbPINVOKE.StringToBoolMap_Remove(swigCPtr, SWIGTYPE_p_std__wstring.getCPtr(key));
284 return ret;
285 }
286
287 private global::System.IntPtr create_iterator_begin() {
288 global::System.IntPtr ret = TD_DbPINVOKE.StringToBoolMap_create_iterator_begin(swigCPtr);
290 return ret;
291 }
292
293 private SWIGTYPE_p_std__wstring get_next_key(global::System.IntPtr swigiterator) {
294 SWIGTYPE_p_std__wstring ret = new SWIGTYPE_p_std__wstring(TD_DbPINVOKE.StringToBoolMap_get_next_key(swigCPtr, swigiterator), false);
295 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
296 return ret;
297 }
298
299 private void destroy_iterator(global::System.IntPtr swigiterator) {
300 TD_DbPINVOKE.StringToBoolMap_destroy_iterator(swigCPtr, swigiterator);
301 if (TD_DbPINVOKE.SWIGPendingException.Pending) throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
302 }
303
304}
305
306}
global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool > Current
global::System.Collections.Generic.ICollection< bool > Values
void CopyTo(global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool >[] array)
void Add(SWIGTYPE_p_std__wstring key, bool value)
bool ContainsKey(SWIGTYPE_p_std__wstring key)
StringToBoolMap(IntPtr cPtr, bool cMemoryOwn)
void CopyTo(global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool >[] array, int arrayIndex)
void Add(global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool > item)
bool Remove(SWIGTYPE_p_std__wstring key)
bool TryGetValue(SWIGTYPE_p_std__wstring key, out bool value)
global::System.Collections.Generic.ICollection< SWIGTYPE_p_std__wstring > Keys
static HandleRef getCPtr(StringToBoolMap obj)
bool Remove(global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool > item)
virtual void Dispose(bool disposing)
bool Contains(global::System.Collections.Generic.KeyValuePair< SWIGTYPE_p_std__wstring, bool > item)
StringToBoolMapEnumerator GetEnumerator()
StringToBoolMap(StringToBoolMap other)
static global::System.Exception Retrieve()
static uint StringToBoolMap_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool StringToBoolMap_empty(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_StringToBoolMap(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool StringToBoolMap_ContainsKey(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr StringToBoolMap_create_iterator_begin(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool StringToBoolMap_getitem(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void StringToBoolMap_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool StringToBoolMap_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void StringToBoolMap_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3)