Beispiel #1
0
        private void reload()
        {
            try
            {
                int i = 0;
                //  foreach (var n in viewcoll.Subviews) { viewcoll.Delete(n); }
            }
            catch { }
            local cal = new local();

            DataSql = new DataSql();



            //foreach (var view in scoll.Subviews)
            //{
            //    view.RemoveFromSuperview();
            //}

            UIbutton = cal.retUIbutton();

            bool isEmpty = UIbutton.Any();

            if (isEmpty)
            {
                Nettab.bar.Change(isEmpty);
            }

            else
            {
                Nettab.bar.Change(false);
            }


            // viewcoll.RegisterClassForSupplementaryView(typeof(CollectionViewCell1), CollectionViewCell1.Key);

            CollectionView.RegisterClassForCell(typeof(CollectionViewCell1), CollectionViewCell1.Key);

            CollectionView.RegisterClassForSupplementaryView(typeof(CollectionViewCell1), UICollectionElementKindSection.Header, CollectionViewCell1.Key);
            CollectionView.Source = new sourcecollection(UIbutton);

            //   scoll.ContentSize = new CGSize(uiv.Frame.Width - 20, ImageView.Count * 15);



            //}
        }
Beispiel #2
0
        private void Actionbutton_Clicked(object sender, EventArgs e)
        {
            this.Player.Pause();
            var alert = UIAlertController.Create("", "", UIAlertControllerStyle.ActionSheet);

            alert.AddAction((UIAlertAction.Create("Save Video", UIAlertActionStyle.Default, async(UIAlertAction obj) =>
            {
                SaveToAlbum(local, "nidal", namefile);
            })));
            alert.AddAction((UIAlertAction.Create("Share", UIAlertActionStyle.Default, (UIAlertAction obj) =>
            {
                var ii = NSUrl.FromFilename(local);

                var imageToShare = ii.Copy();
                var activityItems = new NSObject[] { imageToShare };

                var controller = new UIActivityViewController(activityItems, null);



                this.PresentViewController(controller, true, null);
            })));
            alert.AddAction((UIAlertAction.Create("Delete", UIAlertActionStyle.Destructive, (UIAlertAction obj) => {
                try
                {
                    local cal = new local();
                    //    Images mig =new Images ()
                    cal.remove(this.Title);
                    img.imG.ViewDidLoad();
                }
                catch
                {
                    var armAlert = UIAlertController.Create("database dot open", string.Empty, UIAlertControllerStyle.Alert);
                    var cancelAction1 = UIAlertAction.Create("ok", UIAlertActionStyle.Cancel, alertAction1 => { });

                    armAlert.AddAction(cancelAction1);


                    PresentViewController(armAlert, true, null);
                }

                NavigationController.PopViewController(true);
            })));
            alert.AddAction((UIAlertAction.Create("Rename", UIAlertActionStyle.Default, (UIAlertAction obj) => {
                UITextField field = new UITextField();

                //field.Text = this.Title;
                var frame = new CGRect(40, 40, 300, 60);
                var messbox = UIAlertController.Create("Change a Name", string.Empty, UIAlertControllerStyle.Alert);
                messbox.View.BackgroundColor = UIColor.DarkGray;
                //   UITextField field = null;
                // UITextField field2 = null;
                messbox.AddTextField((textField) =>
                {
                    // field = textField;

                    // Initialize field
                    //  field.Placeholder = placeholder;
                    //  field.Placeholder = library.Messages(0);

                    // field.BackgroundColor = UIColor.Yellow;
                    //    field.Layer.BorderColor = UIColor.Gray.CGColor;

                    //  field.Font = library.Font();
                    field = textField;
                    field.Frame = frame;
                    field.Layer.BorderWidth = 0;
                    //   field.Layer.CornerRadius = 20;
                    //  field = new UITextField(new CoreGraphics.CGRect(10, 60, 300, 60));
                    //  field.SecureTextEntry = true;
                });
                var cancelAction = UIAlertAction.Create(library.StrForm(4), UIAlertActionStyle.Cancel, alertAction => { });
                var okayAction = UIAlertAction.Create(library.StrForm(3), UIAlertActionStyle.Default, alertAction => {
                    string[] data = new string[] { field.Text + ".mp4", this.Title };
                    this.Title = field.Text + ".mp4";
                    local cal = new local();

                    //    Images mig =new Images ()
                    cal.Uplod(data);

                    img.imG.ViewDidLoad();

                    cal.retUIbutton();
                });

                messbox.AddAction(cancelAction);
                messbox.AddAction(okayAction);

                //Present Alert
                PresentViewController(messbox, true, null);
            })));
            alert.AddAction((UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, (UIAlertAction obj) => { })));

            this.PresentViewController(alert, true, null);
        }