Exemplo n.º 1
0
        private void solutionButton_Click(object sender, EventArgs e)
        {
            if (!this.isClassic)
            {
                FlexibleMessageBox.Show("Due to technical reasons, this feature is only available on classic installations of Paint.NET.", "Generate Visual Studio Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            UpdateAllValues();

            using (FolderBrowserDialog fbd = new FolderBrowserDialog())
            {
                fbd.SelectedPath        = Settings.LastSlnDirectory;
                fbd.ShowNewFolderButton = true;
                fbd.Description         = "Choose a Folder to place the generated Visual Studio Solution.";

                if (fbd.ShowDialog() == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    string sourceCode  = ScriptWriter.FullFileTypeSourceCode(this.userCode, this.fileName, this.Author, this.Major, this.Minor, this.URL, this.Description, this.LoadExt, this.SaveExt, this.Layers, this.PluginName);
                    string slnFilePath = Solution.Generate(fbd.SelectedPath, this.fileName, sourceCode, string.Empty, string.Empty);

                    if (slnFilePath != null)
                    {
                        bool success = File.Exists(slnFilePath) && UIUtil.LaunchFolderAndSelectFile(this, slnFilePath);
                        if (!success)
                        {
                            FlexibleMessageBox.Show("Could not navigate to the generated Solution file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }

                    Settings.LastSlnDirectory = fbd.SelectedPath;
                }
            }
        }
Exemplo n.º 2
0
        internal static bool BuildFileTypeDll(string scriptText, string scriptPath, string author, int majorVersion, int minorVersion, string supportURL, string description, string loadExt, string saveExt, bool supoortLayers, string title)
        {
            string projectName = Path.GetFileNameWithoutExtension(scriptPath);
            string sourceCode  = ScriptWriter.FullFileTypeSourceCode(scriptText, projectName, author, majorVersion, minorVersion, supportURL, description, loadExt, saveExt, supoortLayers, title);

            return(BuildDll(projectName, Array.Empty <string>(), sourceCode, ProjectType.FileType));
        }
Exemplo n.º 3
0
        private void sourceButton_Click(object sender, EventArgs e)
        {
            UpdateAllValues();

            string sourceCode = ScriptWriter.FullFileTypeSourceCode(this.userCode, this.fileName, this.Author, this.Major, this.Minor, this.URL, this.Description, this.LoadExt, this.SaveExt, this.Layers, this.PluginName);

            using (ViewSrc VSW = new ViewSrc("Full Source Code", sourceCode, true))
            {
                VSW.ShowDialog();
            }
        }