コード例 #1
0
        /// <summary>
        /// 특보 해당구역 코드 리스트에 해당하는 행정구역 지역코드 문자열(콤마로 구분된 연속된 문자열)을 반환.
        /// </summary>
        /// <returns></returns>
        public string[] GetTargetRegionCodes()
        {
            string[] targetAreaCodes = GetTargetAreaList();
            if (targetAreaCodes == null)
            {
                return(null);
            }

            List <string> targetRegionCodes = new List <string>();

            foreach (string areaCode in targetAreaCodes)
            {
                SWRAnnounceArea areaInfo = BasisData.FindSWRAreaByAreaCode(areaCode);
                if (areaInfo == null || areaInfo.TargetRegions == null)
                {
                    continue;
                }
                foreach (string regionCode in areaInfo.TargetRegions)
                {
                    if (targetRegionCodes.Contains(regionCode))
                    {
                        continue;
                    }
                    targetRegionCodes.Add(regionCode);
                }
            }

            return(targetRegionCodes.ToArray());
        }
コード例 #2
0
        public void DeepCopyFrom(SWRAnnounceArea src)
        {
            System.Diagnostics.Debug.Assert(src != null);

            this.areaCode = src.areaCode;
            this.areaName = src.areaName;

            if (src.targetRegions == null)
            {
                this.targetRegions = null;
                return;
            }

            if (this.targetRegions == null)
            {
                this.targetRegions = new List <string>();
            }
            this.targetRegions.Clear();

            foreach (string regionCode in src.targetRegions)
            {
                string copy = regionCode;
                this.targetRegions.Add(copy);
            }
        }
コード例 #3
0
ファイル: BasisData.cs プロジェクト: jay-JYPark/CAP-System
        public static SWRAnnounceArea FindSWRAreaByAreaCode(string areaCode)
        {
            System.Diagnostics.Debug.Assert(areaCode != null);

            if (areaCode == null || swrAreaInfo == null)
            {
                return(null);
            }

            if (swrAreaInfo.ContainsKey(areaCode))
            {
                SWRAnnounceArea copy = new SWRAnnounceArea();
                copy.DeepCopyFrom(swrAreaInfo[areaCode]);
                return(copy);
            }

            return(null);
        }
コード例 #4
0
        /// <summary>
        /// 특보 해당구역 코드 리스트를 구역명 문자열(콤마로 구분된 연속된 문자열)로 변환.
        /// </summary>
        /// <returns></returns>
        public string GetTargetAreaNames()
        {
            string[] targetAreaCodes = GetTargetAreaList();
            if (targetAreaCodes == null)
            {
                return(string.Empty);
            }

            List <string> regionNames = new List <string>();

            foreach (string areaCode in targetAreaCodes)
            {
                SWRAnnounceArea areaInfo = BasisData.FindSWRAreaByAreaCode(areaCode);
                if (areaInfo == null || areaInfo.TargetRegions == null)
                {
                    continue;
                }
                regionNames.Add(areaInfo.AreaName);
            }

            return(string.Join(",", regionNames));
        }