public Commands(string c) { InitializeComponent(); if (this.IsHandleCreated == false) { this.CreateHandle(); } rb = richTextBox1; rb.AcceptsTab = true; rb.KeyDown += Rb_KeyDown; rb.KeyPress += Rb_KeyPress; _cmd.rb = rb; bg = SystemColors.ControlLight; rb.BackColor = bg; rb.ForeColor = Color.Black; folder = AppDomain.CurrentDomain.BaseDirectory; nav = new Navigators(); string args = GetStartArgs(c); sp = splitContainer1; spd = splitContainer2; ViewDefined(); ViewFolders(); fd = folderLister1; fd.open.Click += Open_Click; bs = folderBrowser1; bs.fd = fd; _cmd.runAndInit(args); P = new ArrayList(); LoadLaunchers(); Focus(); }
public string GetFolder() { CharChanged = false; navs = new Navigators(); string[] cc = rb.Text.Split("\n".ToCharArray()); string s = cc[cc.Length - 1]; cc = s.Split(">".ToCharArray()); s = cc[0]; if (cc.Length <= 1) { return(""); } string b = cc[1]; if (s == "") { return(""); } string[] dd = Directory.GetDirectories(s); foreach (string g in dd) { string d = g; string[] bb = d.Split("\\".ToCharArray()); navs.Add(bb[bb.Length - 1]); } string[] ff = Directory.GetFiles(s); foreach (string g in ff) { string d = Path.GetFileName(g); navs.Add(d); } navs.Sort(); s = navs.Get(b); return(s); }