コード例 #1
0
 public void AddRecordToRepo(AOI aoi)
 {
     if (aoi == null)
     {
         throw new ArgumentNullException("Error: The argument is Null");
     }
     AOICollection.Add(aoi);
 }
コード例 #2
0
        public List <string> SelectFromCommonGridSizes(int selectedSize)
        {
            List <string> files = new List <string>();

            foreach (var aoi in AOICollection.Where(t => t.Selected == true).ToList())
            {
                files.Add(aoi.GetGridFileNameOfGridSize(selectedSize.ToString()));
            }
            return(files);
        }
コード例 #3
0
        public void DeleteRecordFromRepo(int id)
        {
            if (id == 0)
            {
                throw new Exception("Record ID cannot be null");
            }

            int index = 0;

            while (index < AOICollection.Count)
            {
                if (AOICollection[index].ID == id)
                {
                    AOICollection.RemoveAt(index);
                    break;
                }
                index++;
            }
        }
コード例 #4
0
 public AOI GetAOI(string name)
 {
     CurrentEntity = AOICollection.FirstOrDefault(n => n.Name == name);
     return(CurrentEntity);
 }
コード例 #5
0
 public AOI GetAOI(int id)
 {
     CurrentEntity = AOICollection.FirstOrDefault(n => n.ID == id);
     return(CurrentEntity);
 }
コード例 #6
0
 public bool AOINameExist(string name)
 {
     return(AOICollection.Where(t => t.Name == name).FirstOrDefault() != null);
 }
コード例 #7
0
 public List <AOI> GetAllAOI()
 {
     return(AOICollection.ToList());
 }
コード例 #8
0
 public List <AOI> GetSelectedAOIs()
 {
     return(AOICollection.Where(t => t.Selected == true).ToList());
 }
コード例 #9
0
 public int CountSelected()
 {
     return(AOICollection.Count(t => t.Selected == true));
 }