private void Button_click(int number, string text, iEbutton iebutton) { if (img.imG.isSelect() == false) { try { if ((iebutton._isvideor())) { UIStoryboard storyboard = UIStoryboard.FromName("boardimg", null); var view = storyboard.InstantiateViewController("idVid") as AMvideo; // view.creat(iebutton.retbyet()); // var but = (UIButton)sender; // int info = Convert.ToUInt16(but.TitleLabel.Text ); view.file(iebutton.setText(), iebutton.retbyet()); img.imG.NavigationController.PushViewController(view, true); // view.getimge(iebutton.image(), iebutton.setText(), iebutton.buttonnumber()); } else { UIStoryboard storyboard = UIStoryboard.FromName("boardimg", null); var view = storyboard.InstantiateViewController("imageview") as ViewWer; // var but = (UIButton)sender; // int info = Convert.ToUInt16(but.TitleLabel.Text ); img.imG.NavigationController.PushViewController(view, true); view.getimge(iebutton.image(), iebutton.setText(), iebutton.buttonnumber(), iebutton.retbyet()); } } catch { } } else { sourcecollection._collectionViewCell[number].BorderColor(); iebutton.booldelert(); } }
private void setbutton() { for (int icount = 0; icount <= DataSql.databyet.Count; icount++) { iEbutton button = new iEbutton(); button.ext(extfile[icount]); button.whate_is_byte(listByete[icount], icount); // button.creation(icount, DataSql.databyet[icount]); button.getText(nameimage[icount]); button.click += Button_click; if (button._isvideor()) {//change //string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); //string localFilename = nameimage[icount] + ".mov"; //same if I save the file as .mp4 //string localPath = Path.Combine(documentsPath, localFilename); //File.WriteAllBytes(localPath, DataSql.databyet[icount].ToArray()); //var avasset = AVAsset.FromUrl(NSUrl.FromFilename(localPath)); //var avplayerItem = new AVPlayerItem(avasset); //var avplayer = new AVPlayer(avplayerItem); //var avplayerLayer = AVPlayerLayer.FromPlayer(avplayer); //button.localstring(localPath); //File.Delete(localPath); button.creatFilemov(tumbmaillist[icount]); // var capture = UIScreen.MainScreen.Capture(); } else { button.creationimge(); } UIbutton.Add(button); // Thread.Sleep(1000); } }