Esempio n. 1
0
        public void DeepCopyFrom(DisasterInfo src)
        {
            this.category = null;
            this.kindList = null;

            if (src == null)
            {
                return;
            }
            if (src.category != null)
            {
                this.category = new DisasterCategory();
                this.category.DeepCopyFrom(src.category);
            }
            if (src.kindList == null)
            {
                this.kindList = null;
                return;
            }
            this.kindList = new List <DisasterKind>();
            foreach (DisasterKind kind in src.kindList)
            {
                DisasterKind copy = new DisasterKind();
                copy.DeepCopyFrom(kind);

                this.kindList.Add(copy);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// [재난 카테고리 종류]
        /// </summary>
        /// <param name="warnKindCode"></param>
        /// <returns></returns>
        public static DisasterCategory FindDisasterCategoryByID(int categoryID)
        {
            DisasterCategory result = null;

            if (disasterInfo == null)
            {
                return(null);
            }
            foreach (DisasterInfo info in disasterInfo)
            {
                if (info == null || info.Category == null)
                {
                    continue;
                }
                if (info.Category.ID == categoryID)
                {
                    DisasterCategory copy = new DisasterCategory();
                    copy.DeepCopyFrom(info.Category);
                    return(copy);
                }
            }

            return(result);
        }
Esempio n. 3
0
 public DisasterInfo(DisasterCategory category, List <DisasterKind> kindList)
 {
     this.category = category;
     this.kindList = kindList;
 }
Esempio n. 4
0
 public DisasterInfo()
 {
     this.category = new DisasterCategory();
     this.kindList = new List <DisasterKind>();
 }
Esempio n. 5
0
 public void DeepCopyFrom(DisasterCategory src)
 {
     this.identifier = src.identifier;
     this.code       = src.code;
     this.name       = src.name;
 }
Esempio n. 6
0
 public Disaster(DisasterCategory category, DisasterKind kind)
 {
     this.category = category;
     this.kind     = kind;
 }