Пример #1
0
        public void CheckAndFixRegionValues(int index)
        {
            var imageItems = Images.Cast <ImageItem>().ToList();
            var regions    = CollectionViewSource.GetDefaultView(imageItems[index].Regions).Cast <RegionObject>();

            foreach (var regionPosition in regions)
            {
                regionPosition.CheckAndFixRegionValues();
            }
        }
Пример #2
0
 public void RefreshRegions(int index)
 {
     if (index == -1)
     {
         CurrentItemRegions = null;
     }
     else
     {
         var imageItems = Images.Cast <ImageItem>().ToList();
         CurrentItemRegions = CollectionViewSource.GetDefaultView(imageItems[index].Regions);
         _lastIndex         = index;
     }
 }
Пример #3
0
        public bool IsRegAny()
        {
            if (_lastIndex != -1 && Images != null)
            {
                var imageItems = Images.Cast <ImageItem>().ToArray();
                if (!imageItems.Any())
                {
                    return(false);
                }

                return(imageItems[_lastIndex].Regions.Any());
            }
            return(false);
        }
 public IEnumerator<object> GetEnumerator()
 {
     return Images.Cast<object>().GetEnumerator();
 }