/// <summary> /// .iblayoutファイルの一部からメインウインドウを読み込み、復元します。 /// </summary> /// <param name="sr"></param> private static void LoadMainWindow(StreamReader sr) { string data = sr.ReadLine(); if (data != "{") { return; } do { data = sr.ReadLine(); switch (data) { case "// IBWorkspace": data = sr.ReadLine(); IBWorkspace temp = XamlReader.Parse(data) as IBWorkspace; if (temp.IsMainWindowContent) { IBWorkspace.SetToMainwindowContent(temp); } IBWorkspace.AllIBWorkspace.Remove(temp); break; default: break; } }while (data != "}"); return; }
/// <summary> /// .iblayoutファイルの一部からウインドウを一つ読み込み、復元します。 /// </summary> /// <param name="sr"></param> private static void LoadWindow(StreamReader sr) { string data = sr.ReadLine(); if (data != "{") { return; } IBWindow ibw = new IBWindow(); do { data = sr.ReadLine(); switch (data) { case "// Top": ibw.Top = double.Parse(sr.ReadLine()); break; case "// Left": ibw.Left = double.Parse(sr.ReadLine()); break; case "// Height": ibw.Height = double.Parse(sr.ReadLine()); break; case "// Width": ibw.Width = double.Parse(sr.ReadLine()); break; case "// IBWorkspace": data = sr.ReadLine(); IBWorkspace temp = XamlReader.Parse(data) as IBWorkspace; ibw.Content = temp; break; default: break; } }while (data != "}"); ibw.Show(); return; }