Esempio n. 1
0
 public LayoutInfo Get(WindowID id)
 {
     for (int i = 0; i < this.mLayouts.Count; i++)
     {
         if (this.mLayouts[i].mWindowID == id)
             return this.mLayouts[i];
     }
     LayoutInfo li = new LayoutInfo();
     li.mWindowID = id;
     this.mLayouts.Add(li);
     return li;
 }
Esempio n. 2
0
        public void Load()
        {
            System.IO.StreamReader sr;
            try
            {
                sr = new StreamReader(PathManager.LayoutFile.FullName);
            }
            catch
            {
                return;
            }
            string l1 = sr.ReadLine();
            if (l1 == null)
                return;

            int p = l1.IndexOf('=');
            if (p == -1)
                return;

            string what = l1.Substring(0, p);
            l1 = l1.Substring(p + 1);
            if ((what != "Version") && (l1 != "2"))
                return;

            for (;;)
            {
                LayoutInfo li = new LayoutInfo();
                if (li.Load(sr))
                {
                    for (int i = 0; i < this.mLayouts.Count; i++)
                    {
                        if (this.mLayouts[i].mWindowID == li.mWindowID)
                        {
                            this.mLayouts.RemoveAt(i);
                            break;
                        }
                    }

                    this.mLayouts.Add(li);
                }
                else
                    break;
            }
            sr.Close();
        }