Ejemplo n.º 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++;
            }
        }
Ejemplo n.º 2
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++;
                }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
 }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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;
        }
Ejemplo n.º 9
0
        //**************************************************************************
        //  MACROS
        //**************************************************************************

        // global allocation helpers -- use these instead of new and delete
        //#define global_alloc(Type)                          new Type
        //#define global_alloc_nothrow(Type)                  new (std::nothrow) Type
        //#define global_alloc_array(Type, Num)               new Type[Num]
        public static ListBase <T> global_alloc_array <T>(UInt32 Num) where T : new()  //#define global_alloc_array(Type, Num)               new Type[Num]
        {
            ListBase <T> list = new ListBase <T>((int)Num);

            for (int i = 0; i < Num; i++)
            {
                list.Add(new T());
            }

            return(list);
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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);
 }
Ejemplo n.º 12
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);
 }
Ejemplo n.º 13
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);
 }
Ejemplo n.º 14
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;
        }
Ejemplo n.º 15
0
        public void Load()
        {
            if (_objFieldDict == null)
            {
                _objFieldDict = new ListBase <ObjField>();
                _objFieldDict.KeyFieldName = "Name";

                foreach (ObjField obj in _objFieldList)
                {
                    _objFieldDict.Add(obj);
                }
                _objFieldDict.Sort("Orderno", true);
            }
        }
Ejemplo n.º 16
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;
 }
Ejemplo n.º 17
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;
        }
Ejemplo n.º 18
0
        public ListBase <ObjColumnList> GetSubColumnListDict()
        {
            if (_subColumnListDict == null)
            {
                _subColumnListDict = new ListBase <ObjColumnList>();
                _subColumnListDict.KeyFieldName = "Id";

                //将列数组添加至集合
                foreach (ObjColumnList obj in _subColumnList)
                {
                    _subColumnListDict.Add(obj);
                }
            }
            return(_subColumnListDict);
        }
Ejemplo n.º 19
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);
        }
Ejemplo n.º 20
0
        //private ListBase<ObjSubList> _SubListsDict;


        /// <summary>
        /// 获取Form中的从表对象
        /// </summary>
        /// <returns>从表对象集合列表</returns>
        public ListBase <ObjSubList> GetSubListsDict()
        {
            ListBase <ObjSubList> _SubListsDict = new ListBase <ObjSubList>();

            _SubListsDict.KeyFieldName = "Name";

            if (null != _subLists && _subLists.Length > 0)
            {
                foreach (ObjSubList obj in _subLists)
                {
                    _SubListsDict.Add(obj);
                }
            }
            return(_SubListsDict);
        }
Ejemplo n.º 21
0
Archivo: ObjRow.cs Proyecto: JuRogn/OA
        public ListBase<ObjField> GetObjFieldDict()
        {
            if (_objFieldDict == null)
            {
                _objFieldDict = new ListBase<ObjField>();
                _objFieldDict.KeyFieldName = "Name";

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

            }
            return _objFieldDict;
        }
Ejemplo n.º 22
0
 public ListBase <ObjRow> GetRowDict()
 {
     if (_rowDict == null)
     {
         _rowDict = new ListBase <ObjRow>();
         _rowDict.KeyFieldName = "Id";
         if (_rowList != null)
         {
             //将行数组添加至集合
             foreach (ObjRow obj in _rowList)
             {
                 _rowDict.Add(obj);
             }
         }
     }
     return(_rowDict);
 }
Ejemplo n.º 23
0
        public void DiscoverBatteries()
        {
            var batteries = new ListBase <BatteryLogic>();

            var connection = this.Connection as ICommunicateToAddressableBus;

            if (connection != null)
            {
                batteries.Add(new BatteryLogic(new SMBus.BatteryAdapter(new SMBus.SMBusInterface(connection), 0x2a)));
            }

            //var connection = this.Connection as ICommunicateToBus;
            //if (connection != null)
            //	batteries.Add(new BatteryLogic(new LTC6804.BatteryAdapter(connection)));

            this.Batteries = batteries;
        }
Ejemplo n.º 24
0
        private ListBase <string> LoadActiveMessageTypes()
        {
            ListBase <string> objActiveMessageTypes = new ListBase <string>();

            foreach (LogBase objLog in Logs)
            {
                foreach (MessageType objMessageType in objLog.MessageTypes)
                {
                    if (objMessageType.Enabled == true)
                    {
                        bool blnExists = objActiveMessageTypes.Contains(objMessageType.FullName);
                        if (blnExists == false)
                        {
                            objActiveMessageTypes.Add(objMessageType.FullName);
                        }
                    }
                }
            }

            return(objActiveMessageTypes);
        }
Ejemplo n.º 25
0
Archivo: ObjBill.cs Proyecto: JuRogn/OA
        //private ListBase<ObjSubList> _SubListsDict;


        /// <summary>
        /// 获取Form中的从表对象
        /// </summary>
        /// <returns>从表对象集合列表</returns>
        public ListBase<ObjSubList> GetSubListsDict()
        {
            ListBase<ObjSubList> _SubListsDict = new ListBase<ObjSubList>();
            _SubListsDict.KeyFieldName = "Name";

            if (null != _subLists && _subLists.Length > 0)
            {
                foreach (ObjSubList obj in _subLists)
                {
                    _SubListsDict.Add(obj);
                }
            }
            return _SubListsDict;
        }
Ejemplo n.º 26
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;


        }
Ejemplo n.º 27
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;
        }