Exemplo n.º 1
0
 // Token: 0x060004E6 RID: 1254 RVA: 0x00021BEC File Offset: 0x0001FDEC
 private void Handle_Finished(TakePhotoEventArgs args)
 {
     this.Files.Add(args.File);
     if (this.CanTakeMore)
     {
         PhotoView photoView = new PhotoView();
         photoView.Finished += this.Handle_Finished;
         photoView.Closed   += this.Handle_Closed;
         this.photoSL.Children.Add(photoView);
     }
 }
Exemplo n.º 2
0
        // Token: 0x0600053A RID: 1338 RVA: 0x000247F4 File Offset: 0x000229F4
        private static void OnFileChanged(BindableObject bindable, object oldValue, object newValue)
        {
            PhotoView photoView = bindable as PhotoView;

            if (newValue != null)
            {
                TakePhotoHandler finished = photoView.Finished;
                if (finished == null)
                {
                    return;
                }
                finished(new TakePhotoEventArgs
                {
                    File = photoView.File
                });
            }
        }
Exemplo n.º 3
0
        private void InitializeComponent()
        {
            if (ResourceLoader.ResourceProvider != null && ResourceLoader.ResourceProvider(typeof(PhotoCell).GetTypeInfo().Assembly.GetName(), "Layout/PhotoCell.xaml") != null)
            {
                this.__InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(base.GetType()) != null)
            {
                this.__InitComponentRuntime();
                return;
            }
            ColumnDefinition columnDefinition  = new ColumnDefinition();
            ColumnDefinition columnDefinition2 = new ColumnDefinition();
            RowDefinition    rowDefinition     = new RowDefinition();
            Label            label             = new Label();
            PhotoView        photoView         = new PhotoView();
            StackLayout      stackLayout       = new StackLayout();
            StackLayout      stackLayout2      = new StackLayout();
            ScrollView       scrollView        = new ScrollView();
            Grid             grid      = new Grid();
            NameScope        nameScope = new NameScope();

            NameScope.SetNameScope(this, nameScope);
            NameScope.SetNameScope(grid, nameScope);
            NameScope.SetNameScope(columnDefinition, nameScope);
            NameScope.SetNameScope(columnDefinition2, nameScope);
            NameScope.SetNameScope(rowDefinition, nameScope);
            NameScope.SetNameScope(label, nameScope);
            ((INameScope)nameScope).RegisterName("label", label);
            if (label.StyleId == null)
            {
                label.StyleId = "label";
            }
            NameScope.SetNameScope(scrollView, nameScope);
            NameScope.SetNameScope(stackLayout2, nameScope);
            NameScope.SetNameScope(photoView, nameScope);
            ((INameScope)nameScope).RegisterName("firstPhoto", photoView);
            if (photoView.StyleId == null)
            {
                photoView.StyleId = "firstPhoto";
            }
            NameScope.SetNameScope(stackLayout, nameScope);
            ((INameScope)nameScope).RegisterName("photoSL", stackLayout);
            if (stackLayout.StyleId == null)
            {
                stackLayout.StyleId = "photoSL";
            }
            this.label      = label;
            this.firstPhoto = photoView;
            this.photoSL    = stackLayout;
            grid.SetValue(VisualElement.BackgroundColorProperty, Color.White);
            grid.SetValue(Grid.RowSpacingProperty, 5.0);
            grid.SetValue(Layout.PaddingProperty, new Thickness(10.0, 5.0, 10.0, 5.0));
            columnDefinition.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
            grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition);
            columnDefinition2.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("3*"));
            grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition2);
            rowDefinition.SetValue(RowDefinition.HeightProperty, new GridLengthTypeConverter().ConvertFromInvariantString("Auto"));
            grid.GetValue(Grid.RowDefinitionsProperty).Add(rowDefinition);
            BindableObject         bindableObject        = label;
            BindableProperty       fontSizeProperty      = Label.FontSizeProperty;
            IExtendedTypeConverter extendedTypeConverter = new FontSizeConverter();
            string value = "Default";
            XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
            Type typeFromHandle = typeof(IProvideValueTarget);

            object[] array = new object[0 + 3];
            array[0] = label;
            array[1] = grid;
            array[2] = this;
            xamlServiceProvider.Add(typeFromHandle, new SimpleValueTargetProvider(array, Label.FontSizeProperty));
            xamlServiceProvider.Add(typeof(INameScopeProvider), new NameScopeProvider
            {
                NameScope = nameScope
            });
            Type typeFromHandle2 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();

            xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver.Add("layout", "clr-namespace:RFID.Layout");
            xmlNamespaceResolver.Add("svg", "clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms");
            xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(PhotoCell).GetTypeInfo().Assembly));
            xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(16, 20)));
            bindableObject.SetValue(fontSizeProperty, extendedTypeConverter.ConvertFromInvariantString(value, xamlServiceProvider));
            label.SetValue(Label.TextColorProperty, new Color(0.501960813999176, 0.501960813999176, 0.501960813999176, 1.0));
            label.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
            label.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
            label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Start"));
            label.SetValue(Grid.ColumnProperty, 0);
            grid.Children.Add(label);
            scrollView.SetValue(Grid.ColumnProperty, 1);
            scrollView.SetValue(ScrollView.OrientationProperty, ScrollOrientation.Horizontal);
            scrollView.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
            stackLayout2.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
            photoView.Finished += this.Handle_Finished;
            photoView.Closed   += this.Handle_Closed;
            stackLayout2.Children.Add(photoView);
            stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
            stackLayout2.Children.Add(stackLayout);
            scrollView.Content = stackLayout2;
            grid.Children.Add(scrollView);
            this.View = grid;
        }