private Font ReadFont(ProjFileStream pfs, ref Color col) { string name = pfs.ReadString(); float size = pfs.ReadFloat(); FontStyle fs = (FontStyle)pfs.ReadInt(); GraphicsUnit gu = (GraphicsUnit)pfs.ReadInt(); byte cs = pfs.ReadByte(); bool vf = pfs.ReadBool(); col = pfs.ReadColor(); return(new System.Drawing.Font(name, size, fs, gu, cs, vf)); }
private void OpenProject() { listBox1.Items.Clear(); wf.ClearForm(); pf.ClearForm(); ProjFileStream pfs = new ProjFileStream(filename, FileMode.Open, FileAccess.Read); // Видимый шрифт visFont = ReadFont(pfs, ref visCol); wf.VisFont = visFont; pf.VisFont = visFont; wf.VisColor = visCol; pf.VisColor = visCol; // Невидимый шрифт unvFont = ReadFont(pfs, ref unvCol); wf.UnvFont = unvFont; pf.UnvFont = unvFont; wf.UnvColor = unvCol; pf.UnvColor = unvCol; // Количество слов. Должно совпадать! int localWC = pfs.ReadInt(); // Количество заданий int localCNT = pfs.ReadInt(); roundCounter = localCNT; for (int i = 0; i < localCNT; i++) { listBox1.Items.Add(REWRound.LoadRound(pfs, localWC, WordCount)); } if (listBox1.Items.Count > 0) { listBox1.SelectedIndex = 0; } pfs.Close(); Saved = true; }