Beispiel #1
0
        public Album(int _id, String _path, String _root)
        {
            Pictures   = new List <Picture>();
            AlbumInfos = new PlaceInfos();
            Summary    = new AlbumSummary();
            Position   = new GpsLocation();

            Id        = _id.ToString();
            PathAlbum = _path.Replace(_root + "\\", "");
            PathRoot  = _root;

            // download at first import
            _requestLocationUpdate  = true;
            _requestThumbnailUpdate = true;
        }
Beispiel #2
0
 public ConfObj(Page _pageRef, TripSummary _tripSummary, AlbumSummary _albumSummary)
 {
     TripSummary  = _tripSummary;
     AlbumSummary = _albumSummary;
     Page         = _pageRef;
 }
Beispiel #3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _initFinished = false;
            _listLoaded   = false;

            if (e.Parameter is ConfObj)
            {
                TripSummaryRef  = (e.Parameter as ConfObj).TripSummary;
                AlbumSummaryRef = (e.Parameter as ConfObj).AlbumSummary;
                PageRef         = (e.Parameter as ConfObj).Page;
            }
            else
            {
                throw new Exception();
            }

            TripRef = await Trip.LoadFromSummary(TripSummaryRef);

            if ((TripRef.Sample) || !(PageRef is ViewHome))
            {
                TextBoxReadOnly(TripName, true);
                TextBoxReadOnly(TripLocation, true);
            }

            // config from summary
            TripLocation.Text = TripSummaryRef.LocationFromTo;

            if (TripRef.Sample)
            {
                TripName.Text       = TripSummaryRef.LocationMain;
                TripPath.Text       = "Sample";
                btnUpdate.IsEnabled = false;
            }
            else
            {
                TripName.Text = TripSummaryRef.FolderTopName;
                TripPath.Text = TripRef.PathRoot;
            }

            // config from trip
            AlbumNum.Text       = TripRef.Albums.Count().ToString();
            ChkRename.IsChecked = TripRef.Reorganize;

            ChkDropbox.IsChecked = TripSummaryRef.SyncDropbox.Requested;
            UpdateCheckSync(TripSummaryRef.SyncDropbox, ComboDropbox, ChkDropbox);

            ChkUsb.IsChecked = TripSummaryRef.SyncUsb.Requested;
            UpdateCheckSync(TripSummaryRef.SyncUsb, ComboUsb, ChkUsb);

            UpdateLayout();

            // used for selection
            AlbumConfUserControl _itemRef = null;

            int _count = 0;

            foreach (Album _album in TripRef.Albums)
            {
                _count += _album.Pictures.Count;
                AlbumConfUserControl _userControl = new AlbumConfUserControl(_album, NotifyChange);
                listAlbums.Add(_userControl);

                if ((AlbumSummaryRef != null) && (_album.Id == AlbumSummaryRef.Id))
                {
                    _itemRef = _userControl;
                }
            }
            PicNum.Text = _count.ToString();

            tableAlbums.ItemsSource = listAlbums;

            if (_itemRef != null)
            {
                tableAlbums.SelectedItem = _itemRef;
                tableAlbums.ScrollIntoView(_itemRef, ScrollIntoViewAlignment.Leading);
            }

            _initFinished = true;
            ProgressFinished("");

            navigationHelper.OnNavigatedTo(e);
        }