示例#1
0
        public IntPtr Marshal(CimCashInfoObject cashInfo)
        {
            WFSCIMCASHINFO dto = new WFSCIMCASHINFO();

            dto.usCount = cashInfo.usCount;
            WFSCIMCASHIN[] cashunitstructs = new WFSCIMCASHIN[cashInfo.CashIns.Length];
            for (int i = 0; i < cashInfo.CashIns.Length; i++)
            {
                cashunitstructs[i] = CashIn.convertToWFSCIMCASHIN(cashInfo.CashIns[i]);
            }

            dto.lppCashIn = XFSUtil.XFSArrayToPTR <WFSCIMCASHIN>(cashunitstructs);
            return(XFSUtil.StructureToPtr <WFSCIMCASHINFO>(dto));
        }
示例#2
0
        public ISTATUS UnMarshal(IntPtr pointer)
        {
            var cashinfoObj = new CimCashInfoObject();

            var cashunitInfo = new WFSCIMCASHINFO();

            XFSUtil.PtrToStructure <WFSCIMCASHINFO>(pointer, ref cashunitInfo);
            cashinfoObj.usCount = cashunitInfo.usCount;

            var cashUnits = XFSUtil.XFSPtrToArray <WFSCIMCASHIN>(cashunitInfo.lppCashIn, cashunitInfo.usCount);

            cashinfoObj.CashIns = new CashIn[cashUnits.Length];
            for (int i = 0; i < cashUnits.Length; i++)
            {
                cashinfoObj.CashIns[i] = CashIn.convertToCashIn(cashUnits[i]);
            }

            return(cashinfoObj);
        }