// If not using .NET 4.5, http://dotnetzip.codeplex.com/
        private void PhotoScenes_Preview(object sender, RoutedEventArgs e)
        {
            if (e != null)
            {
                e.Handled = true;
            }
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;
            string location             = System.IO.Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory) + item.Name + ".zip";

            if (!File.Exists(location))
            {
                if (e != null)                                                   // Do not enter into an infinite loop
                {
                    outputFormat.SelectedItem = AdskReCap.Format.OBJ.ToString(); // Our viewer support OBJ only
                    PhotoScenes_DownloadResult(null, null);
                }
                return;
            }

            ViewerWindow wnd = new ViewerWindow();

            wnd.Owner = this;
            wnd.Show();
            wnd.LoadModel(location);
        }
        private void PhotoScenes_UploadPhotos(object sender, RoutedEventArgs e)
        {
            e.Handled = true;
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;
            ShotsWindow            wnd  = new ShotsWindow(item.Name);

            wnd.Owner = this;
            wnd.Show();
        }
        private async void PhotoScenes_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            e.Handled = true;
            propertyGrid.SelectedObject = null;
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;

            if (await PhotosceneProperties(item.Name))
            {
                propertyGrid.SelectedObject = new AdskReCapPhotoscene(_recap.xmlLinq());
            }
        }
        private async void PhotoScenes_Properties(object sender, RoutedEventArgs e)
        {
            e.Handled = true;
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;

            if (await PhotosceneProperties(item.Name))
            {
                PropertiesWnd wnd = new PropertiesWnd(new AdskReCapPhotoscene(_recap.xmlLinq()));
                wnd.Owner = this;
                wnd.Show();
            }
        }
        private async void PhotoScenes_ProcessPhotoscene(object sender, RoutedEventArgs e)
        {
            e.Handled = true;
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;

            if (await ProcessPhotoscene(item.Name))
            {
                JobProgress jobWnd = new JobProgress(item.Name);
                jobWnd._callback = new ProcessPhotosceneCompletedDelegate(this.ProcessPhotosceneCompleted);
                jobWnd.Owner     = this;
                jobWnd.Show();
            }
        }
        private async void PhotoScenes_DownloadResult(object sender, RoutedEventArgs e)
        {
            if (e != null)
            {
                e.Handled = true;
            }
            if (PhotoScenes.SelectedItems.Count != 1)
            {
                return;
            }
            ReCapPhotosceneProject item = PhotoScenes.SelectedItem as ReCapPhotosceneProject;

            AdskReCap.Format format = (AdskReCap.Format)((string)outputFormat.SelectedItem).ToReCapFormatEnum();
            string           link   = await GetPhotosceneResult(item.Name, format, e == null);

            if (link != "")
            {
                DownloadReCapResult(item.Name, link, e == null);
            }
        }