コード例 #1
0
        private void OnSelectionChanged(object sender, EventArgs e)
        {
            Log.Debug("OnSelectionChanged");
            if (_doNotFireOnSelectionChanged)
            {
                return;
            }
            var cachedImage = (PhotoWidget)sender;

            if (!AllSelectedPhotos.ContainsKey(Page))
            {
                AllSelectedPhotos[Page] = new Dictionary <string, Photo>();
            }

            if (cachedImage.IsSelected)
            {
                AllSelectedPhotos[Page].Add(cachedImage.Photo.Id, cachedImage.Photo);
            }
            else
            {
                AllSelectedPhotos[Page].Remove(cachedImage.Photo.Id);
            }

            UpdateSelectionButtons();
        }
コード例 #2
0
        private void SelectAlreadySelectedPhotos()
        {
            Log.Debug("SelectAlreadySelectedPhotos");
            if (!AllSelectedPhotos.ContainsKey(Page) || AllSelectedPhotos[Page].Count <= 0)
            {
                return;
            }

            var photos = Photos.Where(photo => AllSelectedPhotos[Page].ContainsKey(photo.Id)).ToList();

            SelectPhotos(photos);
        }
コード例 #3
0
        private void OnSelectionChanged(object sender, EventArgs e)
        {
            Log.Debug("OnSelectionChanged");
            var photoWidget = (PhotoWidget)sender;

            if (!AllSelectedPhotos.ContainsKey(Page))
            {
                AllSelectedPhotos[Page] = new Dictionary <string, Photo>();
            }

            if (photoWidget.IsSelected)
            {
                AllSelectedPhotos[Page].Add(photoWidget.WidgetItem.Id, (Photo)photoWidget.WidgetItem);
            }
            else
            {
                AllSelectedPhotos[Page].Remove(photoWidget.WidgetItem.Id);
            }

            UpdateSelectionButtons();
        }