public string GetThumbnailPath(string thumbnailRoot) { var thumbPath = PhotoPath.Replace(@"\\nasdee\HortImages", thumbnailRoot); var thumbFilename = string.Format("{0}.jpg", PhotoId); return(Path.Combine(thumbPath, thumbFilename)); }
public override int GetHashCode() { int code = 27; code = unchecked ( code ^ EmployeeID.GetHashCode() ^ FirstName.GetHashCode() ^ Title.GetHashCode() ^ TitleOfCourtesy.GetHashCode() ^ BirthDate.GetHashCode() ^ HireDate.GetHashCode() ^ Address.GetHashCode() ^ City.GetHashCode() ^ Region.GetHashCode() ^ PostalCode.GetHashCode() ^ Country.GetHashCode() ^ HomePhone.GetHashCode() ^ Extension.GetHashCode() ^ Photo.GetHashCode() ^ Notes.GetHashCode() ^ ReportsTo.GetHashCode() ^ PhotoPath.GetHashCode() ); return(code); }
public string GetReplacementPath(string replacementRoot, string extension, bool isThumb = false) { // replacementRoot in the form \\Storage1\HortImages, \\DMZ\HortThumbnails var pattern = isThumb ? "{0}{1}.jpg" : "{0}{1}"; var newPath = PhotoPath.Replace(@"\\nasdee\HortImages", replacementRoot); var newFileName = string.Format(pattern, PhotoId, extension); return(Path.Combine(newPath, newFileName)); }
private PhotoPath Upload(String fileName, bool sync) { var photoPath = new PhotoPath(fileName); if (sync) { photoPath = _uploader?.Upload(photoPath).GetAwaiter().GetResult(); } else { _uploader?.Upload(photoPath); } return(photoPath); }
public void CaptureMovie() { //start recording if (!isRecording && CameraMode == CameraModes.Video) { var outputUrl = ApplicationDocumentsDirectory().Append($"Video_{DateTime.Now.ToString("yyMMdd_hhmmss")}", false).AppendPathExtension("mov"); VideoFileUrl = outputUrl.AbsoluteString; // string localFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); // var localPath = System.IO.Path.Combine(localFolder, $"Video_{DateTime.Now.ToString("yyMMdd_hhmmss")}.mov"); // var outputUrl = ApplicationDocumentsDirectory().Append($"Video_{DateTime.Now.ToString("yyMMdd-hhmmss")}", false).AppendPathExtension("mov"); var _delegate = new OutputRecorder(); _delegate.SavedMovie += (sender, e) => { Video?.Invoke(this, VideoFileUrl); /// SavedMovie(this, new ListEventArgs(outputUrl.AbsoluteString, e.error?.LocalizedDescription)); //Analytics.TrackEvent("Trigger seconds SavedMovie Event"); }; movieFileOutput.StartRecordingToOutputFile(outputUrl, _delegate); //takePhotoButton.Hidden = true; //stopRecordButton.Hidden = false; StartedRecordingVideo?.Invoke(this, EventArgs.Empty); } else if (isRecording && CameraMode == CameraModes.Video) { movieFileOutput.StopRecording(); //takePhotoButton.Hidden = false; //stopRecordButton.Hidden = true; } else if (CameraMode == CameraModes.Snapshot) { var cb = new PhotoRecorderDelegate(); cb.SavedPhoto += (object sender, ListEventArgs e) => { /// SavedMovie(this, e); PhotoPath?.Invoke(this, e.MovieUrl); }; var dictionary = new NSDictionary <NSString, NSObject> ( AVVideo.CodecKey, AVVideo.CodecJPEG ); var setting = AVCapturePhotoSettings.FromFormat(dictionary); setting.IsHighResolutionPhotoEnabled = true; setting.IsAutoStillImageStabilizationEnabled = true; photoFileOutput.CapturePhoto(setting, cb); } isRecording = !isRecording; }
public List <PhotoPath> saveUserPhotosAndReturnPaths(String title) { List <PhotoPath> photoPaths = new List <PhotoPath>(); Android.Support.V4.View.ViewPager userPhotos = FindViewById <Android.Support.V4.View.ViewPager>(Resource.Id.userPhotos); for (int index = 1; index < userPhotos.Adapter.Count; index++) { userPhotos.SetCurrentItem(index, false); UserPhotoFragment userPhotoFragment = (UserPhotoFragment)((UserPhotosAdapter)userPhotos.Adapter).GetItem(index); String imagePath = saveImageFromImageView(userPhotoFragment.UserPhoto, title + "_" + "image" + index + ".jpg"); PhotoPath photoPath = new PhotoPath(imagePath); photoPaths.Add(photoPath); } return(photoPaths); }
// If your activity returns a value, derive from CodeActivity<TResult> // and return the value from the Execute method. protected override void Execute(CodeActivityContext context) { // Obtain the runtime value of the Text input argument //string text = context.GetValue(this.Text); TelegramProp telegramDetails = (TelegramProp)context.DataContext.GetProperties()["telegramDetails"].GetValue(context.DataContext); var botToken = telegramDetails.authToken; var photopath = PhotoPath.Get(context); if (photopath == null) { throw new ArgumentException("Photo-Path missing"); } var chatID = ChatID.Get(context); var chatID_str = Convert.ToString(chatID); if (chatID_str == null) { throw new ArgumentException("Chat-ID missing"); } var image_text = Image_Text.Get(context); if (image_text == null) { image_text = "Image sent from Bot"; } var botClient = new TelegramBotClient(botToken); string file = photopath; var fileName = file.Split(Path.DirectorySeparatorChar).Last(); using (var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read)) { Message Photo = botClient.SendPhotoAsync(chatID, fileStream, image_text).GetAwaiter().GetResult(); } }
private void GetFolderIds() { var folderItems = GetFolderInformation(AppRootFolder); if (!folderItems.Collection.Any()) { return; } _toPublishFolderId = folderItems.Collection.First(f => f.Folder != null && f.Name.ToLower() == ToPublishPath.ToLower()).Id; var internPathId = folderItems.Collection.First(f => f.Folder != null && f.Name.ToLower() == InternalPath.ToLower()).Id; var folders = GetFolderInformation("/drive/items/" + internPathId); _photosFolderId = folders.Collection.First(f => f.Folder != null && f.Name.ToLower() == PhotoPath.ToLower()).Id; _memberPathOrId = folders.Collection.First(f => f.Folder != null && f.Name.ToLower() == MemberPath.ToLower()).Id; }
private void Tournament_NewWinnerEvent(int place, PhotoPath item) { lblStatus.Text = $"The photo {item.ToString()} has made to the place #{place}"; }
public void NotifyPhoto(object sender, string filePath) { PhotoPath?.Invoke(this, filePath); }
public Page(PhotoPath photoA, PhotoPath photoB) { PhotoA = photoA; PhotoB = photoB; }