示例#1
0
        private void TrvMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (File.Exists(e.Node.Name))
            {
                //X.509 certificates
                if (e.Node.Name.EndsWith(@".crt"))
                {
                    var certBytes = File.ReadAllBytes(e.Node.Name);
                    var cert      = new X509Certificate2(certBytes);
                    X509Certificate2UI.DisplayCertificate(cert);
                }
                //Arcadyan config
                else if (e.Node.Name.EndsWith(@".dft") || e.Node.Name.EndsWith(@".glbcfg"))
                {
                    SetTable(FileToDataTable(e.Node.Name));
                }

                //SQLite Databases
                else if (e.Node.Name.EndsWith(@".db") || e.Node.Name.EndsWith(@".sqlite"))
                {
                    SqliteBrowser.ShowBrowser(e.Node.Name);
                }

                //Anything else is treated as a text file
                else
                {
                    //try text load
                    SetText(File.ReadAllText(e.Node.Name));
                }
            }
            else
            {
                SetClear();
            }
        }
示例#2
0
        public static void ShowBrowser(string dbFilePath)
        {
            var db = new SqliteBrowser
            {
                DbFile = dbFilePath
            };

            db.ShowDialog();
        }