public void Open(FarsiLibrary.Win.FATabStrip faTabStripMain, string path="") { using (OpenFileDialog ofd = new OpenFileDialog()) { if (string.IsNullOrEmpty(path)) { ofd.Filter = "PList(*.plist)|*.plist|All files|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { path = ofd.FileName; } } if (!string.IsNullOrEmpty(path)) { try { PlistInfo p = new PlistInfo(path); bool suc = p.Read(); CreateTab(faTabStripMain, p.Info.Name, p); if (!suc) { MessageBox.Show("Xml format error"); } } catch (Exception ex) { MessageBox.Show(ex.Message); Debug.WriteLine(ex); } } } }
public void Open(FarsiLibrary.Win.FATabStrip faTabStripMain, string path = "") { using (OpenFileDialog ofd = new OpenFileDialog()) { if (string.IsNullOrEmpty(path)) { ofd.Filter = "PList(*.plist)|*.plist|All files|*.*"; if (ofd.ShowDialog() == DialogResult.OK) { path = ofd.FileName; } } if (!string.IsNullOrEmpty(path)) { try { PlistInfo p = new PlistInfo(path); bool suc = p.Read(); CreateTab(faTabStripMain, p.Info.Name, p); string[] values = path.Split('.'); if (String.Compare("cookie", values[values.Length - 1].Trim()) != 0 && !suc) { MessageBox.Show("Xml format error"); } } catch (Exception ex) { MessageBox.Show(ex.Message); Debug.WriteLine(ex); } } } }