Exemplo n.º 1
0
        private void btnPackager_Click(object sender, EventArgs e)
        {
            ImageEffectPreset preset = GetSelectedPreset();

            if (preset != null)
            {
                if (string.IsNullOrEmpty(preset.Name))
                {
                    // TODO: Translate
                    MessageBox.Show("Preset name cannot be empty.", "ShareX - " + "Missing preset name", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string json = eiImageEffects.Serialize(preset);

                    if (!string.IsNullOrEmpty(json))
                    {
                        using (ImageEffectPackagerForm packagerForm = new ImageEffectPackagerForm(json, preset.Name,
                                                                                                  HelpersOptions.ShareXSpecialFolders["ShareXImageEffects"]))
                        {
                            packagerForm.ShowDialog();
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void btnPackager_Click(object sender, EventArgs e)
        {
            ImageEffectPreset preset = GetSelectedPreset();

            if (preset != null)
            {
                if (string.IsNullOrEmpty(preset.Name))
                {
                    MessageBox.Show(Resources.PresetNameCannotBeEmpty, "ShareX - " + Resources.MissingPresetName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string json = eiImageEffects.Serialize(preset);

                    if (!string.IsNullOrEmpty(json))
                    {
                        using (ImageEffectPackagerForm packagerForm = new ImageEffectPackagerForm(json, preset.Name,
                                                                                                  HelpersOptions.ShareXSpecialFolders["ShareXImageEffects"]))
                        {
                            packagerForm.ShowDialog();
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void btnPackager_Click(object sender, EventArgs e)
        {
            ImageEffectPreset preset = GetSelectedPreset();

            if (preset != null)
            {
                if (string.IsNullOrEmpty(preset.Name))
                {
                    MessageBox.Show(Resources.PresetNameCannotBeEmpty, "ShareX - " + Resources.MissingPresetName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string json = null;

                    try
                    {
                        json = JsonHelpers.SerializeToString(preset, serializationBinder: serializationBinder);
                    }
                    catch (Exception ex)
                    {
                        DebugHelper.WriteException(ex);
                        ex.ShowError();
                    }

                    if (!string.IsNullOrEmpty(json))
                    {
                        using (ImageEffectPackagerForm packagerForm = new ImageEffectPackagerForm(json, preset.Name,
                                                                                                  HelpersOptions.ShareXSpecialFolders["ShareXImageEffects"]))
                        {
                            packagerForm.ShowDialog();
                        }
                    }
                }
            }
        }