private void OpenTextFileToPanel(string cesta) { lastOpened = openedFiles[cesta]; lastOpenedPath = cesta; OnPanel(lastOpened); }
private void OpenFile(string cesta) { if (File.Exists(cesta)) { if (!openedFiles.ContainsKey(cesta)) { TypeOfFile t = FS2.TypeByFileExtension(Path.GetExtension(cesta)); switch (t) { case TypeOfFile.Binary: OnStatus("Binary files can't be open"); break; case TypeOfFile.Image: lastOpened = null; OnPanel(new DisplayImageUC(new Bitmap(cesta))); break; case TypeOfFile.Text: case TypeOfFile.Unknown: openedFiles.Add(cesta, new DisplayTextUC(TF.ReadFile(cesta), null)); OpenTextFileToPanel(cesta); break; default: throw new NotImplementedException(); break; } } else { OpenTextFileToPanel(cesta); } } }