Ejemplo n.º 1
0
        private void LvwResult_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LvwResult.SelectedItems.Count == 0)
            {
                return;
            }
            var sFile = Path.Combine(LvwResult.SelectedItems[0].SubItems[1].Text, LvwResult.SelectedItems[0].Text);

            // Open file and hightlight
            var lang = Language.Custom;
            var ext  = Path.GetExtension(sFile).ToLower();

            switch (ext)
            {
            case ".sql":
                lang = Language.SQL;
                break;

            case ".xml":
            case ".jrxml":
                lang = Language.XML;
                break;

            case ".php":
                lang = Language.PHP;
                break;

            default:
                lang = Language.Custom;
                break;
            }
            TxtFile.Language = lang;
            TxtFile.OpenFile(sFile);
        }