Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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);
        }