示例#1
0
        private void GetCurrentLines(LineStatus[] reference, ref LineStatus[] currentLines)
        {
            int currentLineCompteur = 0;

            foreach (LineStatus ls in reference)
            {
                LineStatus newLine   = new LineStatus();
                LineStatus cacheLine = null;
                if (ls.directoryNumber != "" && Global.cacheMgr.Contains(ls.directoryNumber))
                {
                    cacheLine = Global.cacheMgr.GetData(ls.directoryNumber) as LineStatus;
                }
                newLine.directoryNumber = ls.directoryNumber;
                if (cacheLine == null)
                {
                    newLine.status       = Status.unknown;
                    newLine.doNotDisturb = false;
                    newLine.forward      = "";
                    newLine.mwiOn        = false;
                    newLine.monitored    = "";
                }
                else
                {
                    if (PrivacyService.IsPrivate(cacheLine.directoryNumber))
                    {
                        newLine.status = Status.hidden;
                    }
                    else
                    {
                        newLine.status = cacheLine.status;
                    }
                    newLine.doNotDisturb = cacheLine.doNotDisturb;
                    newLine.forward      = cacheLine.forward;
                    newLine.mwiOn        = cacheLine.mwiOn;
                    newLine.monitored    = cacheLine.monitored;
                }
                currentLines[currentLineCompteur] = newLine;
                currentLineCompteur++;
            }
        }