Extended .NET SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdPsPlotStylesMap.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.Core {
12
13using System;
14using System.Runtime.InteropServices;
15
16public class OdPsPlotStylesMap : global::System.IDisposable
17 , global::System.Collections.Generic.IDictionary<String, OdPsPlotStyle>
18 {
19 private Object locker = new Object();
20 private HandleRef swigCPtr;
21 protected bool swigCMemOwn;
22 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
23 public OdPsPlotStylesMap(IntPtr cPtr, bool cMemoryOwn) {
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new HandleRef(this, cPtr);
26 }
27 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
28 public static HandleRef getCPtr(OdPsPlotStylesMap obj) {
29 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
30 }
31
33 Dispose(false);
34 }
35
36 public void Dispose() {
37 Dispose(true);
38 global::System.GC.SuppressFinalize(this);
39 }
40
41 protected virtual void Dispose(bool disposing) {
42 lock(this) {
43 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
44 if (swigCMemOwn) {
45 swigCMemOwn = false;
47 }
48 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
49 }
50 }
51 }
52
53
54 public OdPsPlotStyle this[String key] {
55 get {
56 return getitem(key);
57 }
58
59 set {
60 setitem(key, value);
61 }
62 }
63
64 public bool TryGetValue(String key, out OdPsPlotStyle value) {
65 if (this.ContainsKey(key)) {
66 value = this[key];
67 return true;
68 }
69 value = default(OdPsPlotStyle);
70 return false;
71 }
72
73 public int Count {
74 get {
75 return (int)size();
76 }
77 }
78
79 public bool IsReadOnly {
80 get {
81 return false;
82 }
83 }
84
85 public global::System.Collections.Generic.ICollection<String> Keys {
86 get {
87 global::System.Collections.Generic.ICollection<String> keys = new global::System.Collections.Generic.List<String>();
88 int size = this.Count;
89 if (size > 0) {
90 global::System.IntPtr iter = create_iterator_begin();
91 for (int i = 0; i < size; i++) {
92 keys.Add(get_next_key(iter));
93 }
94 destroy_iterator(iter);
95 }
96 return keys;
97 }
98 }
99
100 public global::System.Collections.Generic.ICollection<OdPsPlotStyle> Values {
101 get {
102 global::System.Collections.Generic.ICollection<OdPsPlotStyle> vals = new global::System.Collections.Generic.List<OdPsPlotStyle>();
103 foreach (global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle> pair in this) {
104 vals.Add(pair.Value);
105 }
106 return vals;
107 }
108 }
109
110 public void Add(global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle> item) {
111 Add(item.Key, item.Value);
112 }
113
114 public bool Remove(global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle> item) {
115 if (Contains(item)) {
116 return Remove(item.Key);
117 } else {
118 return false;
119 }
120 }
121
122 public bool Contains(global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle> item) {
123 if (this[item.Key] == item.Value) {
124 return true;
125 } else {
126 return false;
127 }
128 }
129
130 public void CopyTo(global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>[] array) {
131 CopyTo(array, 0);
132 }
133
134 public void CopyTo(global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>[] array, int arrayIndex) {
135 if (array == null)
136 throw new global::System.ArgumentNullException("array");
137 if (arrayIndex < 0)
138 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
139 if (array.Rank > 1)
140 throw new global::System.ArgumentException("Multi dimensional array.", "array");
141 if (arrayIndex+this.Count > array.Length)
142 throw new global::System.ArgumentException("Number of elements to copy is too large.");
143
144 global::System.Collections.Generic.IList<String> keyList = new global::System.Collections.Generic.List<String>(this.Keys);
145 for (int i = 0; i < keyList.Count; i++) {
146 String currentKey = keyList[i];
147 array.SetValue(new global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>(currentKey, this[currentKey]), arrayIndex+i);
148 }
149 }
150
151 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>> global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>>.GetEnumerator() {
152 return new OdPsPlotStylesMapEnumerator(this);
153 }
154
155 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
156 return new OdPsPlotStylesMapEnumerator(this);
157 }
158
160 return new OdPsPlotStylesMapEnumerator(this);
161 }
162
163 // Type-safe enumerator
168 public class OdPsPlotStylesMapEnumerator : global::System.Collections.IEnumerator,
169 global::System.Collections.Generic.IEnumerator<global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>>
170 {
171 private OdPsPlotStylesMap collectionRef;
172 private global::System.Collections.Generic.IList<String> keyCollection;
173 private int currentIndex;
174 private object currentObject;
175 private int currentSize;
176
178 collectionRef = collection;
179 keyCollection = new global::System.Collections.Generic.List<String>(collection.Keys);
180 currentIndex = -1;
181 currentObject = null;
182 currentSize = collectionRef.Count;
183 }
184
185 // Type-safe iterator Current
186 public global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle> Current {
187 get {
188 if (currentIndex == -1)
189 throw new global::System.InvalidOperationException("Enumeration not started.");
190 if (currentIndex > currentSize - 1)
191 throw new global::System.InvalidOperationException("Enumeration finished.");
192 if (currentObject == null)
193 throw new global::System.InvalidOperationException("Collection modified.");
194 return (global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>)currentObject;
195 }
196 }
197
198 // Type-unsafe IEnumerator.Current
199 object global::System.Collections.IEnumerator.Current {
200 get {
201 return Current;
202 }
203 }
204
205 public bool MoveNext() {
206 int size = collectionRef.Count;
207 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
208 if (moveOkay) {
209 currentIndex++;
210 String currentKey = keyCollection[currentIndex];
211 currentObject = new global::System.Collections.Generic.KeyValuePair<String, OdPsPlotStyle>(currentKey, collectionRef[currentKey]);
212 } else {
213 currentObject = null;
214 }
215 return moveOkay;
216 }
217
218 public void Reset() {
219 currentIndex = -1;
220 currentObject = null;
221 if (collectionRef.Count != currentSize) {
222 throw new global::System.InvalidOperationException("Collection modified.");
223 }
224 }
225
226 public void Dispose() {
227 currentIndex = -1;
228 currentObject = null;
229 }
230 }
231
232
233 public OdPsPlotStylesMap() : this(GlobalsPINVOKE.new_OdPsPlotStylesMap__SWIG_0(), true) {
235 }
236
237 public OdPsPlotStylesMap(OdPsPlotStylesMap other) : this(GlobalsPINVOKE.new_OdPsPlotStylesMap__SWIG_1(OdPsPlotStylesMap.getCPtr(other)), true) {
239 }
240
241 private uint size() {
242 uint ret = GlobalsPINVOKE.OdPsPlotStylesMap_size(swigCPtr);
244 return ret;
245 }
246
247 public bool empty() {
248 bool ret = GlobalsPINVOKE.OdPsPlotStylesMap_empty(swigCPtr);
250 return ret;
251 }
252
253 public void Clear() {
256 }
257
258 private OdPsPlotStyle getitem(String key) {
259 MemoryManager mMan = MemoryManager.GetMemoryManager();
260 MemoryTransaction mTrans = mMan.GetCurrentTransaction(); // MemoryTransaction #18
261 IntPtr ptr = GlobalsPINVOKE.OdPsPlotStylesMap_getitem(swigCPtr, key);
262
263 OdPsPlotStyle ret = null;
264 if (null != mTrans)
265 {
266 mTrans.AddObject((OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternalUniversal(typeof(OdPsPlotStyle),ptr, true));
267 ret = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternalUniversal(typeof(OdPsPlotStyle),ptr, false);
268 }
269 else
270 {
271 ret = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternalUniversal(typeof(OdPsPlotStyle),ptr, true);
272 }
273
274 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
275 return ret;
276}
277
278 private void setitem(String key, OdPsPlotStyle x) {
279 GlobalsPINVOKE.OdPsPlotStylesMap_setitem(swigCPtr, key, OdPsPlotStyle.getCPtr(x));
280 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
281 }
282
283 public bool ContainsKey(String key) {
284 bool ret = GlobalsPINVOKE.OdPsPlotStylesMap_ContainsKey(swigCPtr, key);
286 return ret;
287 }
288
289 public void Add(String key, OdPsPlotStyle value) {
292 }
293
294 public bool Remove(String key) {
295 bool ret = GlobalsPINVOKE.OdPsPlotStylesMap_Remove(swigCPtr, key);
297 return ret;
298 }
299
300 private global::System.IntPtr create_iterator_begin() {
301 global::System.IntPtr ret = GlobalsPINVOKE.OdPsPlotStylesMap_create_iterator_begin(swigCPtr);
303 return ret;
304 }
305
306 private String get_next_key(global::System.IntPtr swigiterator) {
307 String ret = GlobalsPINVOKE.OdPsPlotStylesMap_get_next_key(swigCPtr, swigiterator);
308 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
309 return ret;
310}
311
312 private void destroy_iterator(global::System.IntPtr swigiterator) {
313 GlobalsPINVOKE.OdPsPlotStylesMap_destroy_iterator(swigCPtr, swigiterator);
314 if (GlobalsPINVOKE.SWIGPendingException.Pending) throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
315 }
316
317}
318
319}
static global::System.Exception Retrieve()
static bool OdPsPlotStylesMap_ContainsKey(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static void OdPsPlotStylesMap_Add(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2, HandleRef jarg3)
static IntPtr OdPsPlotStylesMap_getitem(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static bool OdPsPlotStylesMap_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static bool OdPsPlotStylesMap_empty(global::System.Runtime.InteropServices.HandleRef jarg1)
static void OdPsPlotStylesMap_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static uint OdPsPlotStylesMap_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_OdPsPlotStylesMap(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr OdPsPlotStylesMap_create_iterator_begin(global::System.Runtime.InteropServices.HandleRef jarg1)
static HandleRef getCPtr(OdPsPlotStyle obj)
global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle > Current
OdPsPlotStylesMap(OdPsPlotStylesMap other)
OdPsPlotStylesMap(IntPtr cPtr, bool cMemoryOwn)
void CopyTo(global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle >[] array)
virtual void Dispose(bool disposing)
bool Remove(global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle > item)
bool Contains(global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle > item)
void Add(String key, OdPsPlotStyle value)
bool TryGetValue(String key, out OdPsPlotStyle value)
global::System.Collections.Generic.ICollection< String > Keys
void Add(global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle > item)
static HandleRef getCPtr(OdPsPlotStylesMap obj)
global::System.Collections.Generic.ICollection< OdPsPlotStyle > Values
OdPsPlotStylesMapEnumerator GetEnumerator()
void CopyTo(global::System.Collections.Generic.KeyValuePair< String, OdPsPlotStyle >[] array, int arrayIndex)