Read() public method

public Read ( ) : bool
return bool
Esempio n. 1
0
        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);
                    }
                }
            }
        }
Esempio n. 2
0
 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);
             }
         }
     }
 }