示例#1
0
        protected override void HandleOnNavigatedTo(NavigationEventArgs e)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            //   PhotoPickerPhotos.<>c__DisplayClass25_0 cDisplayClass250 = new PhotoPickerPhotos.<>c__DisplayClass25_0();
            // ISSUE: reference to a compiler-generated field
            //   cDisplayClass250.<>4__this = this;
            base.HandleOnNavigatedTo(e);
            if (!this._isInitialized)
            {
                PhotoPickerPhotosViewModel pickerPhotosViewModel = new PhotoPickerPhotosViewModel(int.Parse(((Page)this).NavigationContext.QueryString["MaxAllowedToSelect"]), bool.Parse(((Page)this).NavigationContext.QueryString["OwnPhotoPick"]));
                pickerPhotosViewModel.PropertyChanged += new PropertyChangedEventHandler(this.vm_PropertyChanged);
                base.DataContext        = pickerPhotosViewModel;
                this._pickToStorageFile = bool.Parse(((Page)this).NavigationContext.QueryString["PickToStorageFile"]);
                this._isInitialized     = true;
            }
            object parameterForIdAndReset = ParametersRepository.GetParameterForIdAndReset("CapturedPhoto");
            // ISSUE: reference to a compiler-generated field
            bool haveCapturedPhoto = parameterForIdAndReset != null;

            // ISSUE: method pointer
            this.VM.LoadData(true, delegate
            {
                if (haveCapturedPhoto)
                {
                    this.SelectCapturedPhoto();
                }
            });
            this.UpdateAppBar();
        }
示例#2
0
        public void Show(int totalCount, string albumId, int ind, Func <int, Image> getImageFunc, Action <int, bool> showHideOriginalImageCallback, PhotoPickerPhotos pickerPage)
        {
            if (this.IsShown)
            {
                return;
            }
            ((UIElement)this).Visibility = Visibility.Visible;
            this._indToShow = ind;
            if (this._pppVM != null)
            {
                this._pppVM.PropertyChanged -= new PropertyChangedEventHandler(this.PickerVM_PropertyChanged);
            }
            this._pppVM = pickerPage.VM;
            this._pppVM.PropertyChanged += new PropertyChangedEventHandler(this.PickerVM_PropertyChanged);
            this._pickerPage             = pickerPage;
            this._totalCount             = totalCount;
            this._savedPageAppBar        = this.Page.ApplicationBar;
            this._albumId       = albumId;
            this._imageEditorVM = this._pickerPage.VM.ImageEditor;
            ((UIElement)this.elliplseSelect).Opacity = (0.0);
            ((UIElement)this.imageSelect).Opacity    = (0.0);
            this.OnPropertyChanged("ImageEditor");
            this.InitializeImageSizes();
            PhoneApplicationPage page = this.Page;

            // ISSUE: variable of the null type
            page.ApplicationBar = (null);
            EventHandler <CancelEventArgs> eventHandler = new EventHandler <CancelEventArgs>(this.Page_BackKeyPress);

            page.BackKeyPress += (eventHandler);
            this.UpdateConfirmButtonState();
            this.imageViewer.Initialize(totalCount, (Func <int, ImageInfo>)(i =>
            {
                double num1 = 0.0;
                double num2 = 0.0;
                if (this._imageSizes.Count > i)
                {
                    Size imageSize1 = this._imageSizes[i];
                    // ISSUE: explicit reference operation
                    num1            = ((Size)@imageSize1).Width;
                    Size imageSize2 = this._imageSizes[i];
                    // ISSUE: explicit reference operation
                    num2 = ((Size)@imageSize2).Height;
                }
                ImageEffectsInfo imageEffectsInfo = this._imageEditorVM.GetImageEffectsInfo(this._albumId, this._totalCount - i - 1);
                if (imageEffectsInfo != null && imageEffectsInfo.ParsedExif != null && (imageEffectsInfo.ParsedExif.Width != 0 && imageEffectsInfo.ParsedExif.Height != 0))
                {
                    num1 = (double)imageEffectsInfo.ParsedExif.Width;
                    num2 = (double)imageEffectsInfo.ParsedExif.Height;
                    if (imageEffectsInfo.ParsedExif.Orientation == ExifOrientation.TopRight || imageEffectsInfo.ParsedExif.Orientation == ExifOrientation.BottomLeft)
                    {
                        double num3 = num1;
                        num1        = num2;
                        num2        = num3;
                    }
                }
                if (imageEffectsInfo != null && imageEffectsInfo.CropRect != null && !this._inCropMode)
                {
                    num1 = (double)imageEffectsInfo.CropRect.Width;
                    num2 = (double)imageEffectsInfo.CropRect.Height;
                }
                return(new ImageInfo()
                {
                    GetSourceFunc = (Func <bool, BitmapSource>)(allowBackgroundCreation => this._imageEditorVM.GetBitmapSource(this._albumId, this._totalCount - i - 1, allowBackgroundCreation)),
                    Width = num1,
                    Height = num2
                });
            }), getImageFunc, showHideOriginalImageCallback, (FrameworkElement)null, (Action <int>)null);
            this.IsShown = true;
            this.ShowViewer();
        }