Beispiel #1
0
        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++;
            }
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
        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++;
                }
        }
Beispiel #7
0
        public void Simple()
        {
            var listBase = new ListBase <int>();

            listBase.AddRange(new [] { 3 });
            Assert.IsTrue(listBase.Contains(3));
        }
Beispiel #8
0
        public void Simple()
        {
            var listBase = new ListBase <int>();

            listBase.Insert(0, 3);
            Assert.IsTrue(listBase.Contains(3));
        }
Beispiel #9
0
        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!"));
        }
Beispiel #10
0
        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!"));
        }
Beispiel #11
0
 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));
 }
Beispiel #12
0
        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));
            }
        }
Beispiel #13
0
        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));
            }
        }
Beispiel #14
0
        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);
        }
Beispiel #15
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);
        }
Beispiel #16
0
        public void Simple()
        {
            var listBase = new ListBase <string> {
                "as", "bs", "c"
            };

            Assert.AreEqual(0, listBase.FindIndex(EndsWiths));
        }
Beispiel #17
0
        public void Simple()
        {
            var listBase = new ListBase <int> {
                3, 4, 5
            };

            Assert.AreEqual(2, listBase.BinarySearch(5));
        }
Beispiel #18
0
        public void Simple()
        {
            var listBase = new ListBase<int>();
            Assert.IsFalse(listBase.IsFixedSize);

            listBase = ListTest.GetTestList();
            Assert.IsFalse(listBase.IsFixedSize);
        }
Beispiel #19
0
        public void Interface()
        {
            var listBase = new ListBase <int> {
                3
            };

            Assert.IsTrue(((IList)listBase).Contains(3));
        }
Beispiel #20
0
        public void IndexCount()
        {
            var listBase = new ListBase <string> {
                "as", "bs", "c"
            };

            Assert.AreEqual(0, listBase.FindIndex(0, 1, EndsWiths));
        }
Beispiel #21
0
        public void Simple()
        {
            var intListBase = new ListBase<int> {4};

            var longListBase = intListBase.ConvertAll(IntToLong);

            Assert.IsTrue(longListBase.Contains(4));
        }
Beispiel #22
0
        public void Index()
        {
            var listBase = new ListBase <string> {
                "as", "bs", "c"
            };

            Assert.AreEqual(1, listBase.FindLastIndex(2, EndsWiths));
        }
Beispiel #23
0
        public void ComparerIndex()
        {
            var listBase = new ListBase <int> {
                3, 4, 5
            };

            Assert.AreEqual(2, listBase.BinarySearch(0, 3, 5, Comparer <int> .Default));
        }
Beispiel #24
0
        public void Simple()
        {
            var listBase = new ListBase<string> { "a", "b" };
            listBase.Reverse();

            Assert.AreEqual("b", listBase[0]);
            Assert.AreEqual("a", listBase[1]);
        }
Beispiel #25
0
        public void Simple()
        {
            var listBase = new ListBase <int> {
                3
            };

            Assert.IsTrue(listBase.AsReadOnly().Contains(3));
        }
Beispiel #26
0
        public void Simple()
        {
            var listBase = new ListBase <int>();

            Assert.AreEqual(0, listBase.Capacity);
            listBase.Capacity = 10;
            Assert.AreEqual(10, listBase.Capacity);
        }
Beispiel #27
0
        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);
        }
Beispiel #29
0
        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;
 }
Beispiel #31
0
        public void Simple()
        {
            var listBase = new ListBase <string>(5)
            {
                "as", "bs", "c"
            };

            listBase.TrimExcess();
            Assert.AreEqual(3, listBase.Capacity);
        }
Beispiel #32
0
 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]);
 }
Beispiel #33
0
        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));
        }
Beispiel #34
0
        public void Simple()
        {
            var intListBase = new ListBase <int> {
                4
            };

            var longListBase = intListBase.ConvertAll(IntToLong);

            Assert.IsTrue(longListBase.Contains(4));
        }
Beispiel #35
0
        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));
        }
Beispiel #36
0
        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);
        }
Beispiel #37
0
 /// <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;
 }
Beispiel #38
0
        public void Simple()
        {
            var listBase = new ListBase <int> {
                3
            };

            listBase[0] = 4;
            Assert.IsTrue(listBase.Contains(4));
            Assert.IsFalse(listBase.Contains(3));
        }
Beispiel #39
0
 /// <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;
 }
Beispiel #40
0
        public static ListBase <int> GetTestList()
        {
            var visitableList = new ListBase <int>(5);

            for (var i = 0; i < 5; i++)
            {
                visitableList.Add(i * 3);
            }

            return(visitableList);
        }
Beispiel #41
0
        public static ListBase<int> GetTestList()
        {
            var visitableList = new ListBase<int>(5);

            for (var i = 0; i < 5; i++)
            {
                visitableList.Add(i * 3);
            }

            return visitableList;
        }
Beispiel #42
0
        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]);
        }
Beispiel #43
0
 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]);
 }
Beispiel #44
0
        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]);
        }
Beispiel #45
0
        public ListBase<ObjColumn> GetColumnDict()
        {
            if (_columnDict == null)
            {
                _columnDict = new ListBase<ObjColumn>();
                _columnDict.KeyFieldName = "Name";
                foreach (ObjColumn obj in _ColumnList)
                {
                    _columnDict.Add(obj);
                }

            }
            return _columnDict;
        }
Beispiel #46
0
 public ListBase<ObjApproval> GetApprovalDict()
 {
     if(_approvalDict==null)
     {
         _approvalDict = new ListBase<ObjApproval>();
         _approvalDict.KeyFieldName = "Approver";
         foreach (ObjApproval obj in _approvalList)
         {
             _approvalDict.Add(obj);
         }
            
     }
     return _approvalDict;
 }
Beispiel #47
0
        public ListBase<ObjAttach> GetAttachDict()
        {
            if (_attachDict == null)
            {
                _attachDict = new ListBase<ObjAttach>();
                _attachDict.KeyFieldName = "Name";
                foreach (ObjAttach obj in _attachList)
                {
                    _attachDict.Add(obj);
                }

            }
            return _attachDict;
        }
Beispiel #48
0
        public ListBase<ObjField> GetObjFieldDict()
        {
            if (_objFieldDict == null)
            {
                _objFieldDict = new ListBase<ObjField>();
                _objFieldDict.KeyFieldName = "Name";

                //将数组转换成集合
                foreach (ObjField obj in _objFieldList)
                {
                    _objFieldDict.Add(obj);
                }

            }
            return _objFieldDict;
        }
Beispiel #49
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;
        }
Beispiel #50
0
 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]);
 }
Beispiel #51
0
 public void Simple()
 {
     var listBase = new ListBase<int> {3};
     Assert.IsTrue(listBase.AsReadOnly().Contains(3));
 }
Beispiel #52
0
 public void Index()
 {
     var listBase = new ListBase<string> { "as", "bs", "c" };
     Assert.AreEqual(1, listBase.FindLastIndex(2, EndsWiths));
 }
Beispiel #53
0
 public void Capacity()
 {
     var listBase = new ListBase<int>(3);
     Assert.AreEqual(3, listBase.Capacity);
 }
Beispiel #54
0
 public void Collection()
 {
     var listBase = new ListBase<int>(new[]{3});
     Assert.IsTrue(listBase.Contains(3));
 }
Beispiel #55
0
 public void Simple()
 {
     var listBase = new ListBase<int>();
 }
Beispiel #56
0
        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;


        }
Beispiel #57
0
 public void Simple()
 {
     var listBase = new ListBase<string>(5) { "as", "bs", "c" };
     listBase.TrimExcess();
     Assert.AreEqual(3, listBase.Capacity);
 }
Beispiel #58
0
 public void ExceptionNullVisitor()
 {
     var visitableList = new ListBase<int>();
     visitableList.AcceptVisitor(null);
 }
Beispiel #59
0
 public void IndexCount()
 {
     var listBase = new ListBase<string> { "as", "bs", "c" };
     Assert.AreEqual(0, listBase.FindIndex(0, 1, EndsWiths));
 }
Beispiel #60
0
 public void Simple()
 {
     var listBase = new ListBase<string> { "as", "bs", "c" };
     Assert.AreEqual(0, listBase.FindIndex(EndsWiths));
 }