public void Simple() { var listBase = new ListBase <int>(); for (var i = 0; i < 100; i++) { listBase.Add(i); } for (var i = 200; i >= 100; i--) { listBase.Add(i); } var newList = SerializeUtil.BinarySerializeDeserialize(listBase); for (var i = 0; i < 100; i++) { Assert.AreEqual(newList[i], i); } var counter = 100; for (var i = 200; i >= 100; i--) { Assert.AreEqual(newList[counter], i); counter++; } }
static int _m_setToggle(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); { UnityEngine.Transform _item = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); string _child = LuaAPI.lua_tostring(L, 3); bool _value = LuaAPI.lua_toboolean(L, 4); gen_to_be_invoked.setToggle(_item, _child, _value); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
public void Simple() { var listBase = new ListBase<int> { 3, 4, 5, 4 }; Assert.AreEqual(3, listBase.LastIndexOf(4)); Assert.AreEqual(3, listBase.LastIndexOf(4, 3)); Assert.AreEqual(3, listBase.LastIndexOf(4, 3, 4)); }
public override void ReadData(SerializedObject objSerializedObject) { base.ReadData(objSerializedObject); SerializedObjectCollection objObjects = objSerializedObject.Objects; FileLog objInternalFileLog = objObjects.GetObject <FileLog>("InternalFileLog", null); if (objInternalFileLog == null) { objInternalFileLog = CreateInternalFileLog(); } InternalFileLog = objInternalFileLog; LogBaseCollection objLogs = objObjects.GetObject <LogBaseCollection>("Logs", null); if (objLogs == null) { objLogs = new LogBaseCollection(); } Logs = objLogs; SyncObject = null; ActiveMessageTypes = null; RegisterLogs(); }
public ListBase <u32> extyoffs; //const u32 * extyoffs; // extended Y offset array for really big layouts public gfx_layout ( u16 width, u16 height, u32 total, u16 planes, u32 [] planeoffset, u32 [] xoffset, u32 [] yoffset, u32 charincrement, ListBase <u32> extxoffs = null, ListBase <u32> extyoffs = null ) { this.width = width; this.height = height; this.total = total; this.planes = planes; Array.Copy(planeoffset, this.planeoffset, planeoffset.Length); Array.Copy(xoffset, this.xoffset, xoffset.Length); Array.Copy(yoffset, this.yoffset, yoffset.Length); this.charincrement = charincrement; this.extxoffs = extxoffs; this.extyoffs = extyoffs; }
public void Simple() { var listBase = new ListBase<int>(); for (var i = 0; i < 100; i++) { listBase.Add(i); } for (var i = 200; i >= 100; i--) { listBase.Add(i); } var newList = SerializeUtil.BinarySerializeDeserialize(listBase); for (var i = 0; i < 100; i++) { Assert.AreEqual(newList[i], i); } var counter = 100; for (var i = 200; i >= 100; i--) { Assert.AreEqual(newList[counter], i); counter++; } }
public void Simple() { var listBase = new ListBase <int>(); listBase.AddRange(new [] { 3 }); Assert.IsTrue(listBase.Contains(3)); }
public void Simple() { var listBase = new ListBase <int>(); listBase.Insert(0, 3); Assert.IsTrue(listBase.Contains(3)); }
static int _m_show(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && translator.Assignable <System.Action>(L, 2)) { System.Action _cb = translator.GetDelegate <System.Action>(L, 2); gen_to_be_invoked.show(_cb); return(0); } if (gen_param_count == 1) { gen_to_be_invoked.show( ); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to ListBase.show!")); }
static int _m_back(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) { bool _update = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.back(_update); return(0); } if (gen_param_count == 1) { gen_to_be_invoked.back( ); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to ListBase.back!")); }
public void Simple() { var listBase = new ListBase<int> { 3, 4, 5 }; Assert.AreEqual(1, listBase.IndexOf(4)); Assert.AreEqual(1, listBase.IndexOf(4, 0)); Assert.AreEqual(1, listBase.IndexOf(4, 0, 3)); }
static int _m_getInput(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); { UnityEngine.Transform _item = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); string _child = LuaAPI.lua_tostring(L, 3); string gen_ret = gen_to_be_invoked.getInput(_item, _child); LuaAPI.lua_pushstring(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_setSliderEvent(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); { UnityEngine.Transform _item = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); string _child = LuaAPI.lua_tostring(L, 3); System.Action <float> _cb = translator.GetDelegate <System.Action <float> >(L, 4); gen_to_be_invoked.setSliderEvent(_item, _child, _cb); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _e_UpdateEvents(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); ListBase gen_to_be_invoked = (ListBase)translator.FastGetCSObj(L, 1); System.Action gen_delegate = translator.GetDelegate <System.Action>(L, 3); if (gen_delegate == null) { return(LuaAPI.luaL_error(L, "#3 need System.Action!")); } if (gen_param_count == 3) { if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { gen_to_be_invoked.UpdateEvents += gen_delegate; return(0); } if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { gen_to_be_invoked.UpdateEvents -= gen_delegate; return(0); } } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } LuaAPI.luaL_error(L, "invalid arguments to ListBase.UpdateEvents!"); return(0); }
public ListBase <Field> GetFieldDict() { if (_fieldDict == null) { _fieldDict = new ListBase <Field>(); _fieldDict.KeyFieldName = "Name"; foreach (ObjField obj in GetObjFieldDict()) { Field field = new Field(); field.FieldName = obj.Name; if (obj.IsLink) { obj.DataType = "Link"; } field.ControlType = ConvertControlType(obj.DataType); field.Value = obj.DataValue; field.CaptionName = obj.Text + ":"; field.Colspan = obj.Colspan; field.CssName = obj.CssName; field.IsVisible = obj.IsVisible; field.ColumnOrder = obj.ColumnOrder; field.IsShowCaption = obj.IsShowCaption; _fieldDict.Add(field); } //_fieldDict.Sort("Orderno", true); } return(_fieldDict); }
public void Simple() { var listBase = new ListBase <string> { "as", "bs", "c" }; Assert.AreEqual(0, listBase.FindIndex(EndsWiths)); }
public void Simple() { var listBase = new ListBase <int> { 3, 4, 5 }; Assert.AreEqual(2, listBase.BinarySearch(5)); }
public void Simple() { var listBase = new ListBase<int>(); Assert.IsFalse(listBase.IsFixedSize); listBase = ListTest.GetTestList(); Assert.IsFalse(listBase.IsFixedSize); }
public void Interface() { var listBase = new ListBase <int> { 3 }; Assert.IsTrue(((IList)listBase).Contains(3)); }
public void IndexCount() { var listBase = new ListBase <string> { "as", "bs", "c" }; Assert.AreEqual(0, listBase.FindIndex(0, 1, EndsWiths)); }
public void Simple() { var intListBase = new ListBase<int> {4}; var longListBase = intListBase.ConvertAll(IntToLong); Assert.IsTrue(longListBase.Contains(4)); }
public void Index() { var listBase = new ListBase <string> { "as", "bs", "c" }; Assert.AreEqual(1, listBase.FindLastIndex(2, EndsWiths)); }
public void ComparerIndex() { var listBase = new ListBase <int> { 3, 4, 5 }; Assert.AreEqual(2, listBase.BinarySearch(0, 3, 5, Comparer <int> .Default)); }
public void Simple() { var listBase = new ListBase<string> { "a", "b" }; listBase.Reverse(); Assert.AreEqual("b", listBase[0]); Assert.AreEqual("a", listBase[1]); }
public void Simple() { var listBase = new ListBase <int> { 3 }; Assert.IsTrue(listBase.AsReadOnly().Contains(3)); }
public void Simple() { var listBase = new ListBase <int>(); Assert.AreEqual(0, listBase.Capacity); listBase.Capacity = 10; Assert.AreEqual(10, listBase.Capacity); }
public void Simple() { var listBase = new ListBase<string> { "a", "b" }; var array = listBase.ToArray(); Assert.AreEqual("a", array[0]); Assert.AreEqual("b", array[1]); }
private WhisperListElement BuildInput(ListBase element) { var listElement = new WhisperListElement { Order = element.Order, Extra = element.Extra, }; switch (element) { case ListDivider listDivider: var divider = new WhisperListElement.Types.Divider { Style = ToProto(listDivider.Style) }; listElement.Divider = divider; break; case ListMessage listMessage: var message = new WhisperListElement.Types.Message { Align = ToProto(listMessage.Align), Body = listMessage.Body, Header = listMessage.Body, Style = ToProto(listMessage.Style) }; listElement.Message = message; break; case ListPair listPair: var pair = new WhisperListElement.Types.Pair { Copyable = listPair.Copyable, Label = listPair.Label, Style = ToProto(listPair.Style), Value = listPair.Value, }; listElement.Pair = pair; break; case ListLink listLink: var link = new WhisperListElement.Types.Link { Align = ToProto(listLink.Align), Href = listLink.Href, Style = ToProto(listLink.Style), Text = listLink.Text, }; listElement.Link = link; break; default: throw new ArgumentOutOfRangeException(nameof(element)); } return(listElement); }
public void Simple() { var listBase = new ListBase <int>(); Assert.IsFalse(listBase.IsFixedSize); listBase = ListTest.GetTestList(); Assert.IsFalse(listBase.IsFixedSize); }
public WcfServiceHostSettings(WcfServiceBehavior objBehavior, WcfServiceThrottling objThrottling, Type objType, ListBase <string> objBaseAddresses, WcfServiceEndpointList objServiceEndpoints, WcfMetadataEndpoint objMetadataEndpoint) : base() { Behavior = objBehavior; Throttling = objThrottling; Type = objType; BaseAddresses = objBaseAddresses; ServiceEndpoints = objServiceEndpoints; MetadataEndpoint = objMetadataEndpoint; }
public void Simple() { var listBase = new ListBase <string>(5) { "as", "bs", "c" }; listBase.TrimExcess(); Assert.AreEqual(3, listBase.Capacity); }
public void Comparer() { var listBase = new ListBase<int> {3,2,6,9,1}; listBase.Sort(Comparer<int>.Default); Assert.AreEqual(1, listBase[0]); Assert.AreEqual(2, listBase[1]); Assert.AreEqual(3, listBase[2]); Assert.AreEqual(6, listBase[3]); Assert.AreEqual(9, listBase[4]); }
public void Simple() { var listBase = new ListBase <int> { 3, 4, 5 }; Assert.AreEqual(1, listBase.IndexOf(4)); Assert.AreEqual(1, listBase.IndexOf(4, 0)); Assert.AreEqual(1, listBase.IndexOf(4, 0, 3)); }
public void Simple() { var intListBase = new ListBase <int> { 4 }; var longListBase = intListBase.ConvertAll(IntToLong); Assert.IsTrue(longListBase.Contains(4)); }
public void Simple() { var listBase = new ListBase <int> { 3, 4, 5, 4 }; Assert.AreEqual(3, listBase.LastIndexOf(4)); Assert.AreEqual(3, listBase.LastIndexOf(4, 3)); Assert.AreEqual(3, listBase.LastIndexOf(4, 3, 4)); }
public void Simple() { var listBase = new ListBase <string> { "as", "bs", "c" }; Assert.AreEqual(2, listBase.RemoveAll(EndsWiths)); Assert.AreEqual("c", listBase[0]); Assert.AreEqual(1, listBase.Count); }
/// <summary> /// 获取样式模板 /// </summary> /// <returns>返回样式模板集合</returns> public ListBase<ObjTemplate> GetTemplate() { ListBase<ObjTemplate> _TemplateDict = new ListBase<ObjTemplate>(); _TemplateDict.KeyFieldName = "Name"; foreach (ObjTemplate obj in _arrTemplate) { _TemplateDict.Add( obj); } return _TemplateDict; }
public void Simple() { var listBase = new ListBase <int> { 3 }; listBase[0] = 4; Assert.IsTrue(listBase.Contains(4)); Assert.IsFalse(listBase.Contains(3)); }
/// <summary> /// 获取查看类型 /// </summary> /// <returns>返回查看类型集合</returns> public ListBase<ObjViewmode> GetViewmode() { ListBase<ObjViewmode> _ViewmodeDict = new ListBase<ObjViewmode>(); _ViewmodeDict.KeyFieldName = "Name"; foreach (ObjViewmode obj in _arrViewmode) { _ViewmodeDict.Add( obj); } return _ViewmodeDict; }
public static ListBase <int> GetTestList() { var visitableList = new ListBase <int>(5); for (var i = 0; i < 5; i++) { visitableList.Add(i * 3); } return(visitableList); }
public static ListBase<int> GetTestList() { var visitableList = new ListBase<int>(5); for (var i = 0; i < 5; i++) { visitableList.Add(i * 3); } return visitableList; }
public void Complex() { var listBase = new ListBase<string> {"a", "b"}; var array = new string[2]; listBase.CopyTo(0, array, 0, 2); Assert.AreEqual("a", array[0]); Assert.AreEqual("b", array[1]); }
public void Comparison() { var listBase = new ListBase<int> {3,2,6,9,1}; Comparison<int> comparison = IntComparison; listBase.Sort(comparison); Assert.AreEqual(1, listBase[0]); Assert.AreEqual(2, listBase[1]); Assert.AreEqual(3, listBase[2]); Assert.AreEqual(6, listBase[3]); Assert.AreEqual(9, listBase[4]); }
public void Simple() { var listBase = new ListBase<string> {"a", "b"}; var array = new string[2]; listBase.CopyTo(array); Assert.AreEqual("a", array[0]); Assert.AreEqual("b", array[1]); }
public ListBase<ObjColumn> GetColumnDict() { if (_columnDict == null) { _columnDict = new ListBase<ObjColumn>(); _columnDict.KeyFieldName = "Name"; foreach (ObjColumn obj in _ColumnList) { _columnDict.Add(obj); } } return _columnDict; }
public ListBase<ObjApproval> GetApprovalDict() { if(_approvalDict==null) { _approvalDict = new ListBase<ObjApproval>(); _approvalDict.KeyFieldName = "Approver"; foreach (ObjApproval obj in _approvalList) { _approvalDict.Add(obj); } } return _approvalDict; }
public ListBase<ObjAttach> GetAttachDict() { if (_attachDict == null) { _attachDict = new ListBase<ObjAttach>(); _attachDict.KeyFieldName = "Name"; foreach (ObjAttach obj in _attachList) { _attachDict.Add(obj); } } return _attachDict; }
public ListBase<ObjField> GetObjFieldDict() { if (_objFieldDict == null) { _objFieldDict = new ListBase<ObjField>(); _objFieldDict.KeyFieldName = "Name"; //将数组转换成集合 foreach (ObjField obj in _objFieldList) { _objFieldDict.Add(obj); } } return _objFieldDict; }
public ListBase<Field> GetFieldDict() { if (_fieldDict == null) { _fieldDict = new ListBase<Field>(); _fieldDict.KeyFieldName = "Name"; foreach (ObjField obj in GetObjFieldDict()) { Field field = new Field(); field.FieldName = obj.Name; if (obj.IsLink) { obj.DataType = "Link"; } field.ControlType = ConvertControlType(obj.DataType); field.Value = obj.DataValue; field.CaptionName = obj.Text + ":"; field.Colspan = obj.Colspan; field.CssName = obj.CssName; field.IsVisible = obj.IsVisible; field.ColumnOrder = obj.ColumnOrder; field.IsShowCaption = obj.IsShowCaption; _fieldDict.Add(field); } //_fieldDict.Sort("Orderno", true); } return _fieldDict; }
public void Simple() { var listBase = new ListBase<int> {3,2,6,9,1}; listBase.Sort(); Assert.AreEqual(1, listBase[0]); Assert.AreEqual(2, listBase[1]); Assert.AreEqual(3, listBase[2]); Assert.AreEqual(6, listBase[3]); Assert.AreEqual(9, listBase[4]); }
public void Simple() { var listBase = new ListBase<int> {3}; Assert.IsTrue(listBase.AsReadOnly().Contains(3)); }
public void Index() { var listBase = new ListBase<string> { "as", "bs", "c" }; Assert.AreEqual(1, listBase.FindLastIndex(2, EndsWiths)); }
public void Capacity() { var listBase = new ListBase<int>(3); Assert.AreEqual(3, listBase.Capacity); }
public void Collection() { var listBase = new ListBase<int>(new[]{3}); Assert.IsTrue(listBase.Contains(3)); }
public void Simple() { var listBase = new ListBase<int>(); }
public ListBase<ObjField> GetObjFieldDict() { if (_objFieldDict == null) { _objFieldDict = new ListBase<ObjField>(); _objFieldDict.KeyFieldName = "Name"; foreach (ObjField obj in _objFieldList) { _objFieldDict.Add(obj); } _objFieldDict.Sort("Orderno", true); } return _objFieldDict; }
public void Simple() { var listBase = new ListBase<string>(5) { "as", "bs", "c" }; listBase.TrimExcess(); Assert.AreEqual(3, listBase.Capacity); }
public void ExceptionNullVisitor() { var visitableList = new ListBase<int>(); visitableList.AcceptVisitor(null); }
public void IndexCount() { var listBase = new ListBase<string> { "as", "bs", "c" }; Assert.AreEqual(0, listBase.FindIndex(0, 1, EndsWiths)); }
public void Simple() { var listBase = new ListBase<string> { "as", "bs", "c" }; Assert.AreEqual(0, listBase.FindIndex(EndsWiths)); }