Beispiel #1
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 1)
            {
                if (lastFileName != "")
                {
                    textBox1.Text = lastFileName;
                    lastFileName  = "";
                }
                textBox1.Enabled = true;
                switch (listView1.SelectedItems[0].Text.ToLower())
                {
                case "modx file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".xml";
                    break;

                case "text template file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".mod";
                    break;

                case "gpl v2 license":
                    lastFileName     = (lastFileName == "") ? textBox1.Text : lastFileName;
                    textBox1.Text    = "license.txt";
                    textBox1.Enabled = false;
                    break;

                case "php file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".php";
                    break;

                case "html file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".html";
                    break;

                case "template file":
                    // TODO: change file extension based on phpBB version
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".tpl";
                    break;

                case "css file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".css";
                    break;

                case "text file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".txt";
                    break;

                case "xslt file":
                    textBox1.Text = Studio.CleanFileExtension(textBox1.Text) + ".xsl";
                    break;

                case "prosilver xslt file":
                    lastFileName     = (lastFileName == "") ? textBox1.Text : lastFileName;
                    textBox1.Text    = "modx.prosilver.en.xsl";
                    textBox1.Enabled = false;
                    break;

                case "subsilver xslt file":
                    lastFileName     = (lastFileName == "") ? textBox1.Text : lastFileName;
                    textBox1.Text    = "modx.subsilver.en.xsl";
                    textBox1.Enabled = false;
                    break;
                }
            }
        }