private void OpenStickerForm(bool creating) { Manager.Form.Pause(); try { using (StickerForm stickerForm = new StickerForm(AnnotationOptions.StickerPacks, AnnotationOptions.SelectedStickerPack, AnnotationOptions.StickerSize)) { if (stickerForm.ShowDialog() == DialogResult.OK) { AnnotationOptions.SelectedStickerPack = stickerForm.SelectedStickerPack; AnnotationOptions.StickerSize = stickerForm.StickerSize; if (LoadSticker(stickerForm.SelectedImageFile, stickerForm.StickerSize)) { if (creating) { OnCreated(); } return; } } } if (creating) { Remove(); } } finally { Manager.Form.Resume(); } }
private void OpenStickerForm(bool creating) { Manager.Form.Pause(); try { using (StickerForm stickerForm = new StickerForm(AnnotationOptions.StickerPacks, AnnotationOptions.SelectedStickerPack, AnnotationOptions.StickerSize)) { if (stickerForm.ShowDialog() == DialogResult.OK) { AnnotationOptions.SelectedStickerPack = stickerForm.SelectedStickerPack; AnnotationOptions.StickerSize = stickerForm.StickerSize; if (!string.IsNullOrEmpty(stickerForm.SelectedImageFile)) { Image img = ImageHelpers.LoadImage(stickerForm.SelectedImageFile); img = ImageHelpers.ResizeImageLimit(img, stickerForm.StickerSize); if (img != null) { SetImage(img, true); if (creating) { OnCreated(); } return; } } } } if (creating) { Remove(); } } finally { Manager.Form.Resume(); } }
private bool OpenStickerForm() { Manager.Form.Pause(); try { using (StickerForm stickerForm = new StickerForm(AnnotationOptions.StickerPacks, AnnotationOptions.SelectedStickerPack, AnnotationOptions.StickerSize)) { if (stickerForm.ShowDialog(Manager.Form) == DialogResult.OK) { AnnotationOptions.SelectedStickerPack = stickerForm.SelectedStickerPack; AnnotationOptions.StickerSize = stickerForm.StickerSize; return(LoadSticker(stickerForm.SelectedImageFile, stickerForm.StickerSize)); } } } finally { Manager.Form.Resume(); } return(false); }