Exemplo n.º 1
0
        /// <summary>Search AvailableElementData by mission code (aka commercial number).</summary>
        /// <param name="commercialNumber">Mission code (aka commercial number)</param>
        /// <returns>list of found AvailableElementData.</returns>
        internal ElementList <AvailableElementData> GetAvailableElementDataListByMissionCode(string commercialNumber)
        {
            ElementList <AvailableElementData> elementDataList = new ElementList <AvailableElementData>();

            if (!string.IsNullOrEmpty(commercialNumber))
            {
                IList <SystemInfo> systemList;
                lock (_systemListLock)
                {
                    systemList = _systemList.Where(element => (element.Value.PisMission != null && element.Value.PisMission.CommercialNumber == commercialNumber)).Select(e => e.Value).ToList();
                }

                elementDataList.Capacity = systemList.Count;
                foreach (SystemInfo system in systemList)
                {
                    AvailableElementData elementData = T2GDataConverter.BuildAvailableElementData(system);

                    if (elementData != null)
                    {
                        elementDataList.Add(elementData);
                    }
                }
            }

            return(elementDataList);
        }
Exemplo n.º 2
0
        /// <summary>Search AvailableElementData By ElementNumber.</summary>
        /// <param name="elementNumber">element number.</param>
        /// <param name="objAvailableElementData">[out] Information describing the object available element.</param>
        /// <returns>if found return AvailableElementData else null.</returns>
        internal AvailableElementData GetAvailableElementDataByElementNumber(string elementNumber)
        {
            AvailableElementData elementData = null;

            if (!string.IsNullOrEmpty(elementNumber))
            {
                lock (_systemListLock)
                {
                    SystemInfo system;
                    if (_systemList.TryGetValue(elementNumber, out system))
                    {
                        elementData = T2GDataConverter.BuildAvailableElementData(system);
                    }
                }
            }

            return(elementData);
        }
Exemplo n.º 3
0
        /// <summary>Get all AvailableElementData</summary>
        /// <returns>list of all AvailableElementData.</returns>
        internal ElementList <AvailableElementData> GetAvailableElementDataList()
        {
            ElementList <AvailableElementData> elementDataList = new ElementList <AvailableElementData>();

            lock (_systemListLock)
            {
                elementDataList.Capacity = _systemList.Count;
                foreach (KeyValuePair <string, SystemInfo> system in _systemList)
                {
                    AvailableElementData elementData = T2GDataConverter.BuildAvailableElementData(system.Value);

                    if (elementData != null)
                    {
                        elementDataList.Add(elementData);
                    }
                }
            }

            return(elementDataList);
        }