static int _m_GetEnumerator(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Collections.Generic.Dictionary <string, UnityEngine.GameObject> gen_to_be_invoked = (System.Collections.Generic.Dictionary <string, UnityEngine.GameObject>)translator.FastGetCSObj(L, 1); { var gen_ret = gen_to_be_invoked.GetEnumerator( ); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_GetEnumerator(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Collections.Generic.Dictionary <ulong, xc.GoodsEquip> __cl_gen_to_be_invoked = (System.Collections.Generic.Dictionary <ulong, xc.GoodsEquip>)translator.FastGetCSObj(L, 1); try { { System.Collections.Generic.Dictionary <ulong, xc.GoodsEquip> .Enumerator __cl_gen_ret = __cl_gen_to_be_invoked.GetEnumerator( ); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
protected internal override MsgPack.Serialization.ComplexType UnpackFromCore(MsgPack.Unpacker unpacker) { MsgPack.Serialization.ComplexType result = default(MsgPack.Serialization.ComplexType); result = new MsgPack.Serialization.ComplexType(); if (unpacker.IsArrayHeader) { int unpacked = default(int); int itemsCount = default(int); itemsCount = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); System.Uri nullable = default(System.Uri); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(0); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable = this._serializer1.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable = default(MsgPack.Unpacker); disposable = unpacker.ReadSubtree(); try { nullable = this._serializer1.UnpackFrom(disposable); } finally { if (((disposable == null) == false)) { disposable.Dispose(); } } } } if (((nullable == null) == false)) { result.Source = nullable; } unpacked = (unpacked + 1); byte[] nullable0 = default(byte[]); if ((unpacked < itemsCount)) { nullable0 = MsgPack.Serialization.UnpackHelpers.UnpackBinaryValue(unpacker, typeof(MsgPack.Serialization.ComplexType), "Byte[] Data"); } if (((nullable0 == null) == false)) { result.Data = nullable0; } unpacked = (unpacked + 1); System.Nullable <System.DateTime> nullable1 = default(System.Nullable <System.DateTime>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(2); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable1 = this._serializer6.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable0 = default(MsgPack.Unpacker); disposable0 = unpacker.ReadSubtree(); try { nullable1 = this._serializer6.UnpackFrom(disposable0); } finally { if (((disposable0 == null) == false)) { disposable0.Dispose(); } } } } if (nullable1.HasValue) { result.TimeStamp = nullable1.Value; } unpacked = (unpacked + 1); System.Collections.Generic.Dictionary <System.DateTime, string> nullable2 = default(System.Collections.Generic.Dictionary <System.DateTime, string>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(3); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable2 = this._serializer4.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable1 = default(MsgPack.Unpacker); disposable1 = unpacker.ReadSubtree(); try { nullable2 = this._serializer4.UnpackFrom(disposable1); } finally { if (((disposable1 == null) == false)) { disposable1.Dispose(); } } } } if (((nullable2 == null) == false)) { System.Collections.Generic.Dictionary <System.DateTime, string> .Enumerator enumerator = nullable2.GetEnumerator(); System.Collections.Generic.KeyValuePair <System.DateTime, string> current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; result.History.Add(current.Key, current.Value); } } finally { enumerator.Dispose(); } } unpacked = (unpacked + 1); System.Collections.Generic.List <int> nullable3 = default(System.Collections.Generic.List <int>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(4); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable3 = this._serializer5.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable2 = default(MsgPack.Unpacker); disposable2 = unpacker.ReadSubtree(); try { nullable3 = this._serializer5.UnpackFrom(disposable2); } finally { if (((disposable2 == null) == false)) { disposable2.Dispose(); } } } } if (((nullable3 == null) == false)) { if ((result.Points == null)) { this._methodBaseComplexType_set_Points0.Invoke(result, new object[] { nullable3 }); } else { System.Collections.Generic.List <int> .Enumerator enumerator0 = nullable3.GetEnumerator(); int current0; try { for ( ; enumerator0.MoveNext(); ) { current0 = enumerator0.Current; result.Points.Add(current0); } } finally { enumerator0.Dispose(); } } } unpacked = (unpacked + 1); } else { int itemsCount0 = default(int); itemsCount0 = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); for (int i = 0; (i < itemsCount0); i = (i + 1)) { string key = default(string); string nullable4 = default(string); nullable4 = MsgPack.Serialization.UnpackHelpers.UnpackStringValue(unpacker, typeof(MsgPack.Serialization.ComplexType), "MemberName"); if (((nullable4 == null) == false)) { key = nullable4; } else { throw MsgPack.Serialization.SerializationExceptions.NewNullIsProhibited("MemberName"); } if ((key == "Points")) { System.Collections.Generic.List <int> nullable9 = default(System.Collections.Generic.List <int>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable9 = this._serializer5.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable6 = default(MsgPack.Unpacker); disposable6 = unpacker.ReadSubtree(); try { nullable9 = this._serializer5.UnpackFrom(disposable6); } finally { if (((disposable6 == null) == false)) { disposable6.Dispose(); } } } if (((nullable9 == null) == false)) { if ((result.Points == null)) { this._methodBaseComplexType_set_Points0.Invoke(result, new object[] { nullable9 }); } else { System.Collections.Generic.List <int> .Enumerator enumerator2 = nullable9.GetEnumerator(); int current2; try { for ( ; enumerator2.MoveNext(); ) { current2 = enumerator2.Current; result.Points.Add(current2); } } finally { enumerator2.Dispose(); } } } } else { if ((key == "History")) { System.Collections.Generic.Dictionary <System.DateTime, string> nullable8 = default(System.Collections.Generic.Dictionary <System.DateTime, string>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable8 = this._serializer4.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable5 = default(MsgPack.Unpacker); disposable5 = unpacker.ReadSubtree(); try { nullable8 = this._serializer4.UnpackFrom(disposable5); } finally { if (((disposable5 == null) == false)) { disposable5.Dispose(); } } } if (((nullable8 == null) == false)) { System.Collections.Generic.Dictionary <System.DateTime, string> .Enumerator enumerator1 = nullable8.GetEnumerator(); System.Collections.Generic.KeyValuePair <System.DateTime, string> current1; try { for ( ; enumerator1.MoveNext(); ) { current1 = enumerator1.Current; result.History.Add(current1.Key, current1.Value); } } finally { enumerator1.Dispose(); } } } else { if ((key == "TimeStamp")) { System.Nullable <System.DateTime> nullable7 = default(System.Nullable <System.DateTime>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable7 = this._serializer6.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable4 = default(MsgPack.Unpacker); disposable4 = unpacker.ReadSubtree(); try { nullable7 = this._serializer6.UnpackFrom(disposable4); } finally { if (((disposable4 == null) == false)) { disposable4.Dispose(); } } } if (nullable7.HasValue) { result.TimeStamp = nullable7.Value; } } else { if ((key == "Data")) { byte[] nullable6 = default(byte[]); nullable6 = MsgPack.Serialization.UnpackHelpers.UnpackBinaryValue(unpacker, typeof(MsgPack.Serialization.ComplexType), "Byte[] Data"); if (((nullable6 == null) == false)) { result.Data = nullable6; } } else { if ((key == "Source")) { System.Uri nullable5 = default(System.Uri); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable5 = this._serializer1.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable3 = default(MsgPack.Unpacker); disposable3 = unpacker.ReadSubtree(); try { nullable5 = this._serializer1.UnpackFrom(disposable3); } finally { if (((disposable3 == null) == false)) { disposable3.Dispose(); } } } if (((nullable5 == null) == false)) { result.Source = nullable5; } } else { unpacker.Skip(); } } } } } } } return(result); }
public System.Collections.IEnumerator GetEnumerator() { return(data_.GetEnumerator()); }
protected internal override MsgPack.Serialization.ComplexTypeWithNonSerialized UnpackFromCore(MsgPack.Unpacker unpacker) { MsgPack.Serialization.ComplexTypeWithNonSerialized result = default(MsgPack.Serialization.ComplexTypeWithNonSerialized); result = new MsgPack.Serialization.ComplexTypeWithNonSerialized(); if (unpacker.IsArrayHeader) { int unpacked = default(int); int itemsCount = default(int); itemsCount = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); byte[] nullable = default(byte[]); if ((unpacked < itemsCount)) { nullable = MsgPack.Serialization.UnpackHelpers.UnpackBinaryValue(unpacker, typeof(MsgPack.Serialization.ComplexTypeWithNonSerialized), "Byte[] Data"); } if (((nullable == null) == false)) { result.Data = nullable; } unpacked = (unpacked + 1); System.Collections.Generic.Dictionary <System.DateTime, string> nullable0 = default(System.Collections.Generic.Dictionary <System.DateTime, string>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(1); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable0 = this._serializer2.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable = default(MsgPack.Unpacker); disposable = unpacker.ReadSubtree(); try { nullable0 = this._serializer2.UnpackFrom(disposable); } finally { if (((disposable == null) == false)) { disposable.Dispose(); } } } } if (((nullable0 == null) == false)) { System.Collections.Generic.Dictionary <System.DateTime, string> .Enumerator enumerator = nullable0.GetEnumerator(); System.Collections.Generic.KeyValuePair <System.DateTime, string> current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; ((System.Collections.Generic.Dictionary <System.DateTime, string>)(this._methodBaseComplexTypeWithNonSerialized_get_History38.Invoke(result, null))).Add(current.Key, current.Value); } } finally { enumerator.Dispose(); } } unpacked = (unpacked + 1); System.Uri nullable1 = default(System.Uri); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(2); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable1 = this._serializer3.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable0 = default(MsgPack.Unpacker); disposable0 = unpacker.ReadSubtree(); try { nullable1 = this._serializer3.UnpackFrom(disposable0); } finally { if (((disposable0 == null) == false)) { disposable0.Dispose(); } } } } if (((nullable1 == null) == false)) { result.Source = nullable1; } unpacked = (unpacked + 1); System.Nullable <System.DateTime> nullable2 = default(System.Nullable <System.DateTime>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(3); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable2 = this._serializer5.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable1 = default(MsgPack.Unpacker); disposable1 = unpacker.ReadSubtree(); try { nullable2 = this._serializer5.UnpackFrom(disposable1); } finally { if (((disposable1 == null) == false)) { disposable1.Dispose(); } } } } if (nullable2.HasValue) { result.TimeStamp = nullable2.Value; } unpacked = (unpacked + 1); } else { int itemsCount0 = default(int); itemsCount0 = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); for (int i = 0; (i < itemsCount0); i = (i + 1)) { string key = default(string); string nullable3 = default(string); nullable3 = MsgPack.Serialization.UnpackHelpers.UnpackStringValue(unpacker, typeof(MsgPack.Serialization.ComplexTypeWithNonSerialized), "MemberName"); if (((nullable3 == null) == false)) { key = nullable3; } else { throw MsgPack.Serialization.SerializationExceptions.NewNullIsProhibited("MemberName"); } if ((key == "TimeStamp")) { System.Nullable <System.DateTime> nullable7 = default(System.Nullable <System.DateTime>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable7 = this._serializer5.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable4 = default(MsgPack.Unpacker); disposable4 = unpacker.ReadSubtree(); try { nullable7 = this._serializer5.UnpackFrom(disposable4); } finally { if (((disposable4 == null) == false)) { disposable4.Dispose(); } } } if (nullable7.HasValue) { result.TimeStamp = nullable7.Value; } } else { if ((key == "Source")) { System.Uri nullable6 = default(System.Uri); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable6 = this._serializer3.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable3 = default(MsgPack.Unpacker); disposable3 = unpacker.ReadSubtree(); try { nullable6 = this._serializer3.UnpackFrom(disposable3); } finally { if (((disposable3 == null) == false)) { disposable3.Dispose(); } } } if (((nullable6 == null) == false)) { result.Source = nullable6; } } else { if ((key == "History")) { System.Collections.Generic.Dictionary <System.DateTime, string> nullable5 = default(System.Collections.Generic.Dictionary <System.DateTime, string>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable5 = this._serializer2.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable2 = default(MsgPack.Unpacker); disposable2 = unpacker.ReadSubtree(); try { nullable5 = this._serializer2.UnpackFrom(disposable2); } finally { if (((disposable2 == null) == false)) { disposable2.Dispose(); } } } if (((nullable5 == null) == false)) { System.Collections.Generic.Dictionary <System.DateTime, string> .Enumerator enumerator0 = nullable5.GetEnumerator(); System.Collections.Generic.KeyValuePair <System.DateTime, string> current0; try { for ( ; enumerator0.MoveNext(); ) { current0 = enumerator0.Current; ((System.Collections.Generic.Dictionary <System.DateTime, string>)(this._methodBaseComplexTypeWithNonSerialized_get_History38.Invoke(result, null))).Add(current0.Key, current0.Value); } } finally { enumerator0.Dispose(); } } } else { if ((key == "Data")) { byte[] nullable4 = default(byte[]); nullable4 = MsgPack.Serialization.UnpackHelpers.UnpackBinaryValue(unpacker, typeof(MsgPack.Serialization.ComplexTypeWithNonSerialized), "Byte[] Data"); if (((nullable4 == null) == false)) { result.Data = nullable4; } } } } } } } return(result); }
protected internal override void PackToCore(MsgPack.Packer packer, System.Collections.Generic.Dictionary <MsgPack.MessagePackObject, MsgPack.MessagePackObject> objectTree) { packer.PackMapHeader(objectTree.Count); System.Collections.Generic.Dictionary <MsgPack.MessagePackObject, MsgPack.MessagePackObject> .Enumerator enumerator = objectTree.GetEnumerator(); System.Collections.Generic.KeyValuePair <MsgPack.MessagePackObject, MsgPack.MessagePackObject> current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; this._serializer0.PackTo(packer, current.Key); this._serializer0.PackTo(packer, current.Value); } } finally { enumerator.Dispose(); } }
/// <summary> /// If the current is not ASPX page but ASCX controls, the controls in this ASCX control has id starting with underscore. /// To avoid confusion in formula, we also define variable name without underscore. /// </summary> /// <remarks></remarks> private void AddVariableNameWithoutUnderscore() { System.Collections.Generic.Dictionary <string, object> vars = new System.Collections.Generic.Dictionary <string, object>(); System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <string, object> > enumerator = this.Evaluator.Variables.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Key.StartsWith("_")) { string varNameWitoutUnderscore = enumerator.Current.Key.Substring(1); if (!this.Evaluator.Variables.ContainsKey(varNameWitoutUnderscore)) { vars.Add(varNameWitoutUnderscore, enumerator.Current.Value); } } } System.Collections.Generic.Dictionary <string, object> .Enumerator enumerator2 = vars.GetEnumerator(); while (enumerator2.MoveNext()) { this.Evaluator.Variables.Add(enumerator2.Current.Key, enumerator2.Current.Value); } }
private void SetUnpackedValueOfHistory(MsgPack.Serialization.ComplexType unpackingContext, System.Collections.Generic.Dictionary <System.DateTime, string> unpackedValue) { System.Collections.Generic.Dictionary <System.DateTime, string> existent = default(System.Collections.Generic.Dictionary <System.DateTime, string>); existent = unpackingContext.History; System.Collections.Generic.Dictionary <System.DateTime, string> .Enumerator enumerator = unpackedValue.GetEnumerator(); System.Collections.Generic.KeyValuePair <System.DateTime, string> current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; existent.Add(current.Key, current.Value); } } finally { enumerator.Dispose(); } }
/// <summary> /// Loads the elements collection. /// </summary> protected void Load() { if (Invalid) { IsInitialized = false; } if (!IsInitialized) { Collection = new System.Collections.Generic.List <OlapElement>(0); System.Collections.Specialized.StringCollection elementNames = null; if (_subset != null) { OlapSubsetDefinition subsetDef = new OlapSubsetDefinition(); subsetDef.LongName = _subset.LongName; subsetDef.RefName = _subset.ReferenceName; elementNames = NativeOlapApi.DimensionSubsetElements(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, subsetDef, _dimension.Server.LastErrorInternal); } else if (_element != null) { switch (_elementsLevel) { case OlapElementsLevel.OlapElementsLevelParents: elementNames = NativeOlapApi.DimensionElementParents(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _element.Name, _dimension.Server.LastErrorInternal); break; case OlapElementsLevel.OlapElementsLevelChildren: if (!_ignorePermissionsForChildren) { elementNames = NativeOlapApi.DimensionElementChildren(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _element.Name, _dimension.Server.LastErrorInternal); } else { System.Collections.Generic.Dictionary <string, bool> allElementNames = NativeOlapApi.DimensionElementAllChildren(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _element.Name, _dimension.Server.LastErrorInternal); if (allElementNames != null) { System.Collections.Generic.Dictionary <string, bool> .Enumerator enumNames = allElementNames.GetEnumerator(); while (enumNames.MoveNext()) { System.Collections.Generic.KeyValuePair <string, bool> de = enumNames.Current; OlapElement newElement = new OlapElement(_dimension, de.Key); if (de.Value) { newElement.CanAccess = true; } else { newElement.CanAccess = false; } Collection.Add(newElement); } } else { if (_dimension.Server.LastErrorInternal.Value != 0) { throw new OlapException("Receiving the element collection failed!", _dimension.Server.LastErrorInternal.Value); } } Invalid = false; IsInitialized = true; return; } break; case OlapElementsLevel.OlapElementsLevelTopLevel: elementNames = NativeOlapApi.DimensionTopLevelElements(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _dimension.Server.LastErrorInternal); break; } } else { switch (_elementsLevel) { case OlapElementsLevel.OlapElementsLevelTopLevel: elementNames = NativeOlapApi.DimensionTopLevelElements(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _dimension.Server.LastErrorInternal); break; case OlapElementsLevel.OlapElementsLevelAll: elementNames = NativeOlapApi.DimensionElements(_dimension.Server.Store.ClientSlot, _dimension.Server.ServerHandle, _dimension.Name, _dimension.Server.LastErrorInternal); break; } } if (elementNames != null) { for (int i = 0; i < elementNames.Count; i++) { OlapElement newElement = new OlapElement(_dimension, elementNames[i]); newElement.CanAccess = true; Collection.Add(newElement); } } else { if (_dimension.Server.LastErrorInternal.Value != 0) { throw new OlapException("Receiving the element collection failed!", _dimension.Server.LastErrorInternal.Value); } } Invalid = false; IsInitialized = true; } }
public static void Test_perf_quad_tree() { com.epl.geometry.Envelope extent1 = new com.epl.geometry.Envelope(); extent1.SetCoords(-1000, -1000, 1000, 1000); com.epl.geometry.RandomCoordinateGenerator generator1 = new com.epl.geometry.RandomCoordinateGenerator(1000, extent1, 0.001); //HiResTimer timer; for (int N = 16; N <= 1024; N *= 2) { //timer.StartMeasurement(); com.epl.geometry.Envelope2D extent = new com.epl.geometry.Envelope2D(); extent.SetCoords(-1000, -1000, 1000, 1000); System.Collections.Generic.Dictionary <int, com.epl.geometry.Envelope2D> data = new System.Collections.Generic.Dictionary <int, com.epl.geometry.Envelope2D>(0); com.epl.geometry.QuadTree qt = new com.epl.geometry.QuadTree(extent, 10); for (int i = 0; i < N; i++) { com.epl.geometry.Envelope2D env = new com.epl.geometry.Envelope2D(); com.epl.geometry.Point2D center = generator1.GetRandomCoord().GetXY(); double w = 10; env.SetCoords(center, w, w); env.Intersect(extent); if (env.IsEmpty()) { continue; } int h = qt.Insert(i, env); data[h] = env; } int ecount = 0; com.epl.geometry.AttributeStreamOfInt32 handles = new com.epl.geometry.AttributeStreamOfInt32(0); com.epl.geometry.QuadTree.QuadTreeIterator iter = qt.GetIterator(); System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <int, com.epl.geometry.Envelope2D> > pairs = data.GetEnumerator(); while (pairs.MoveNext()) { System.Collections.Generic.KeyValuePair <int, com.epl.geometry.Envelope2D> entry = pairs.Current; iter.ResetIterator((com.epl.geometry.Envelope2D)entry.Value, 0.001); bool remove_self = false; for (int h = iter.Next(); h != -1; h = iter.Next()) { if (h != entry.Key) { handles.Add(h); } else { remove_self = true; } ecount++; } for (int i_1 = 0; i_1 < handles.Size(); i_1++) { qt.RemoveElement(handles.Get(i_1)); } //remove elements that were selected. if (remove_self) { qt.RemoveElement(entry.Key); } handles.Resize(0); } } }
private void butOn_Click(object sender, System.EventArgs e) { DataTable dataTable = (DataTable)this.dgvInfo.DataSource; System.Collections.Generic.List <DevSnmpConfig> list = new System.Collections.Generic.List <DevSnmpConfig>(); System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <int> > dictionary = new System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <int> >(); this.m_parent.endTimer(); DialogResult dialogResult = EcoMessageBox.ShowWarning(EcoLanguage.getMsg(LangRes.OPCrm_on, new string[0]), MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.Cancel) { this.m_parent.starTimer(); return; } foreach (DataRow dataRow in dataTable.Rows) { string text = dataRow[0].ToString(); string value = dataRow[3].ToString(); if (dictionary.ContainsKey(text)) { System.Collections.Generic.List <int> list2 = dictionary[text]; list2.Add(System.Convert.ToInt32(value)); } else { dictionary.Add(text, new System.Collections.Generic.List <int> { System.Convert.ToInt32(value) }); } } System.Collections.Generic.Dictionary <string, System.Collections.Generic.List <int> > .Enumerator enumerator2 = dictionary.GetEnumerator(); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); while (enumerator2.MoveNext()) { System.Collections.Generic.KeyValuePair <string, System.Collections.Generic.List <int> > current = enumerator2.Current; string text = current.Key; stringBuilder.Append(text + ","); } string text2 = stringBuilder.ToString(); if (text2.Length > 1) { text2 = text2.Substring(0, text2.Length - 1); } System.Collections.Generic.List <DeviceInfo> list3 = (System.Collections.Generic.List <DeviceInfo>)ClientAPI.RemoteCall(7, 1, text2, 10000); if (list3 == null) { list3 = new System.Collections.Generic.List <DeviceInfo>(); } foreach (DeviceInfo current2 in list3) { string text = current2.DeviceID.ToString(); DevSnmpConfig sNMPpara = commUtil.getSNMPpara(current2); sNMPpara.groupOutlets = dictionary[text]; list.Add(sNMPpara); } DevPortGroupAPI devPortGroupAPI = new DevPortGroupAPI(list); bool flag = devPortGroupAPI.TurnOnGroupOutlets(); if (flag) { EcoMessageBox.ShowInfo(EcoLanguage.getMsg(LangRes.OPsucc, new string[0])); } else { EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.OPfail, new string[0])); } this.m_parent.starTimer(); }
private static System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, string>> GetUserLatestPostsFromResult(System.Collections.ArrayList result) { System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, string>> list = new System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, string>>(); try { try { System.Collections.IEnumerator enumerator = result.GetEnumerator(); while (enumerator.MoveNext()) { object objectValue = System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(enumerator.Current); System.Collections.Generic.Dictionary<string, string> dictionary = new System.Collections.Generic.Dictionary<string, string>(); dictionary.Add("id", ""); dictionary.Add("link", ""); dictionary.Add("thumbnail-image", ""); dictionary.Add("lowres-image", ""); dictionary.Add("highres-image", ""); dictionary.Add("lowres-video", ""); dictionary.Add("highres-video", ""); dictionary.Add("description", ""); dictionary.Add("description-notags", ""); dictionary.Add("tags", ""); dictionary.Add("latitude", ""); dictionary.Add("longitude", ""); dictionary.Add("location", ""); if (Conversions.ToBoolean(NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "id" }, null, null, null))) { dictionary["id"] = Conversions.ToString(NewLateBinding.LateIndexGet(objectValue, new object[] { "id" }, null)); } if (Conversions.ToBoolean(NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "link" }, null, null, null))) { dictionary["link"] = Conversions.ToString(NewLateBinding.LateIndexGet(objectValue, new object[] { "link" }, null)); } if (Conversions.ToBoolean(NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "videos" }, null, null, null))) { dictionary.Add("video", ""); System.Collections.Generic.Dictionary<string, object> dictionary2 = (System.Collections.Generic.Dictionary<string, object>)NewLateBinding.LateIndexGet(objectValue, new object[] { "videos" }, null); try { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator2 = dictionary2.GetEnumerator(); while (enumerator2.MoveNext()) { System.Collections.Generic.KeyValuePair<string, object> current = enumerator2.Current; string key = current.Key; if (Operators.CompareString(key, "low_bandwidth", false) == 0) { System.Collections.Generic.Dictionary<string, object> dictionary3 = (System.Collections.Generic.Dictionary<string, object>)current.Value; dictionary["lowres-video"] = Conversions.ToString(dictionary3["url"]); } else if (Operators.CompareString(key, "standard_resolution", false) == 0) { System.Collections.Generic.Dictionary<string, object> dictionary4 = (System.Collections.Generic.Dictionary<string, object>)current.Value; dictionary["highres-video"] = Conversions.ToString(dictionary4["url"]); } } } finally { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator2; ((System.IDisposable)enumerator2).Dispose(); } } if (Conversions.ToBoolean((!Conversions.ToBoolean(NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "location" }, null, null, null)) || !Conversions.ToBoolean(NewLateBinding.LateIndexGet(objectValue, new object[] { "location" }, null) != null)) ? false : true)) { System.Collections.Generic.Dictionary<string, object> dictionary5 = (System.Collections.Generic.Dictionary<string, object>)NewLateBinding.LateIndexGet(objectValue, new object[] { "location" }, null); try { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator3 = dictionary5.GetEnumerator(); while (enumerator3.MoveNext()) { System.Collections.Generic.KeyValuePair<string, object> current2 = enumerator3.Current; string key2 = current2.Key; if (Operators.CompareString(key2, "latitude", false) == 0) { dictionary["latitude"] = Conversions.ToString(current2.Value); } else if (Operators.CompareString(key2, "longitude", false) == 0) { dictionary["longitude"] = Conversions.ToString(current2.Value); } else if (Operators.CompareString(key2, "name", false) == 0) { dictionary["location"] = Conversions.ToString(current2.Value); } } } finally { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator3; ((System.IDisposable)enumerator3).Dispose(); } } if (NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "images" }, null, null, null) != null) { System.Collections.Generic.Dictionary<string, object> dictionary6 = (System.Collections.Generic.Dictionary<string, object>)NewLateBinding.LateIndexGet(objectValue, new object[] { "images" }, null); try { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator4 = dictionary6.GetEnumerator(); while (enumerator4.MoveNext()) { System.Collections.Generic.KeyValuePair<string, object> current3 = enumerator4.Current; string key3 = current3.Key; if (Operators.CompareString(key3, "thumbnail", false) == 0) { System.Collections.Generic.Dictionary<string, object> dictionary7 = (System.Collections.Generic.Dictionary<string, object>)current3.Value; dictionary["thumbnail-image"] = Conversions.ToString(dictionary7["url"]); } else if (Operators.CompareString(key3, "low_resolution", false) == 0) { System.Collections.Generic.Dictionary<string, object> dictionary8 = (System.Collections.Generic.Dictionary<string, object>)current3.Value; dictionary["lowres-image"] = Conversions.ToString(dictionary8["url"]); } else if (Operators.CompareString(key3, "standard_resolution", false) == 0) { System.Collections.Generic.Dictionary<string, object> dictionary9 = (System.Collections.Generic.Dictionary<string, object>)current3.Value; dictionary["highres-image"] = Conversions.ToString(dictionary9["url"]); } } } finally { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator4; ((System.IDisposable)enumerator4).Dispose(); } } if (NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "caption" }, null, null, null) != null) { System.Collections.Generic.Dictionary<string, object> dictionary10 = (System.Collections.Generic.Dictionary<string, object>)NewLateBinding.LateIndexGet(objectValue, new object[] { "caption" }, null); try { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator5 = dictionary10.GetEnumerator(); while (enumerator5.MoveNext()) { System.Collections.Generic.KeyValuePair<string, object> current4 = enumerator5.Current; string key4 = current4.Key; if (Operators.CompareString(key4, "text", false) == 0) { dictionary["description"] = Conversions.ToString(current4.Value); dictionary["description-notags"] = Conversions.ToString(current4.Value); } } } finally { System.Collections.Generic.Dictionary<string, object>.Enumerator enumerator5; ((System.IDisposable)enumerator5).Dispose(); } } if (NewLateBinding.LateGet(objectValue, null, "containskey", new object[] { "tags" }, null, null, null) != null) { System.Collections.ArrayList arrayList = (System.Collections.ArrayList)NewLateBinding.LateIndexGet(objectValue, new object[] { "tags" }, null); bool flag = false; try { System.Collections.Generic.IEnumerator<object> enumerator6 = (from f in arrayList.ToArray().ToList<object>() orderby f.ToString().Length descending select f).GetEnumerator(); while (enumerator6.MoveNext()) { object objectValue2 = System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(enumerator6.Current); dictionary["tags"] = Conversions.ToString(Operators.AddObject(Operators.AddObject(dictionary["tags"] + "#", objectValue2), ",")); dictionary["description-notags"] = dictionary["description-notags"].Replace(Conversions.ToString(Operators.AddObject(" #", objectValue2)), "", System.StringComparison.OrdinalIgnoreCase); flag = true; } } finally { System.Collections.Generic.IEnumerator<object> enumerator6; if (enumerator6 != null) { enumerator6.Dispose(); } } if (flag) { dictionary["tags"] = dictionary["tags"].Substring(0, checked(dictionary["tags"].Length - 1)); } } list.Add(dictionary); } } finally { System.Collections.IEnumerator enumerator; if (enumerator is System.IDisposable) { (enumerator as System.IDisposable).Dispose(); } } } catch (System.Exception expr_743) { ProjectData.SetProjectError(expr_743); ProjectData.ClearProjectError(); } return list; }