void Remember() { // Remember Video Source Settings.Video.SourceKind = VideoViewModel.SelectedVideoSourceKind.Name; switch (VideoViewModel.SelectedVideoSourceKind) { case RegionSourceProvider _: var rect = _regionProvider.SelectedRegion; Settings.Video.Source = RectangleConverter.ConvertToInvariantString(rect); break; default: Settings.Video.Source = VideoViewModel.SelectedVideoSource.ToString(); break; } // Remember Video Codec Settings.Video.WriterKind = VideoViewModel.SelectedVideoWriterKind.Name; Settings.Video.Writer = VideoViewModel.SelectedVideoWriter.ToString(); // Remember Audio Sources Settings.Audio.Microphone = AudioSource.SelectedRecordingSource.ToString(); Settings.Audio.Speaker = AudioSource.SelectedLoopbackSource.ToString(); // Remember ScreenShot Format Settings.ScreenShots.ImageFormat = SelectedScreenShotImageFormat.ToString(); // Remember ScreenShot Target Settings.ScreenShots.SaveTarget = VideoViewModel.SelectedImageWriter.ToString(); // Remember Webcam Settings.Video.Webcam = WebCamProvider.SelectedCam.Name; }
public void Remember() { // Remember Video Source _settings.Video.SourceKind = _videoViewModel.SelectedVideoSourceKind.Name; switch (_videoViewModel.SelectedVideoSourceKind) { case RegionSourceProvider _: var rect = _regionProvider.SelectedRegion; _settings.Video.Source = RectangleConverter.ConvertToInvariantString(rect); break; default: _settings.Video.Source = _videoViewModel.SelectedVideoSource.ToString(); break; } // Remember Video Codec _settings.Video.WriterKind = _videoViewModel.SelectedVideoWriterKind.Name; _settings.Video.Writer = _videoViewModel.SelectedVideoWriter.ToString(); // Remember Audio Sources _settings.Audio.Microphones = _audioSource.AvailableRecordingSources .Where(M => M.Active) .Select(M => M.Name) .ToArray(); _settings.Audio.Speakers = _audioSource.AvailableLoopbackSources .Where(M => M.Active) .Select(M => M.Name) .ToArray(); // Remember ScreenShot Format _settings.ScreenShots.ImageFormat = _screenShotViewModel.SelectedScreenShotImageFormat.ToString(); // Remember ScreenShot Target _settings.ScreenShots.SaveTargets = _videoViewModel.AvailableImageWriters .Where(M => M.Active) .Select(M => M.Display) .ToArray(); // Remember Webcam _settings.Video.Webcam = _webCamProvider.SelectedCam.Name; }
void RememberVideoSource() { void SaveSourceName() { _settings.Video.Source = _videoViewModel.SelectedVideoSourceKind.Source.ToString(); } switch (_videoViewModel.SelectedVideoSourceKind) { case NoVideoSourceProvider _: _settings.Video.SourceKind = VideoSourceKindEnum.NoVideo; SaveSourceName(); break; case RegionSourceProvider _: _settings.Video.SourceKind = VideoSourceKindEnum.Region; var rect = _regionProvider.SelectedRegion; _settings.Video.Source = RectangleConverter.ConvertToInvariantString(rect); break; case WindowSourceProvider _: _settings.Video.SourceKind = VideoSourceKindEnum.Window; SaveSourceName(); break; case ScreenSourceProvider _: _settings.Video.SourceKind = VideoSourceKindEnum.Screen; SaveSourceName(); break; case DeskDuplSourceProvider _: _settings.Video.SourceKind = VideoSourceKindEnum.DeskDupl; SaveSourceName(); break; default: _settings.Video.SourceKind = VideoSourceKindEnum.FullScreen; _settings.Video.Source = ""; break; } }
public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding, bool upstream) { XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding); // Use indenting for readability xmlOut.Formatting = Formatting.Indented; if (!upstream) { xmlOut.WriteStartDocument(); } // Always begin file with identification and warning xmlOut.WriteComment(Resources.DockPanel_Persistor_XmlFileComment1); xmlOut.WriteComment(Resources.DockPanel_Persistor_XmlFileComment2); // Associate a version number with the root element so that future version of the code // will be able to be backwards compatible or at least recognise out of date versions xmlOut.WriteStartElement("DockPanel"); xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion); xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture)); // Contents xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString(CultureInfo.InvariantCulture)); foreach (IDockContent content in dockPanel.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("PersistString", content.DockHandler.PersistString); xmlOut.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // Panes xmlOut.WriteStartElement("Panes"); xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in dockPanel.Panes) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockState", pane.DockState.ToString()); xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString(CultureInfo.InvariantCulture)); foreach (IDockContent content in pane.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // DockWindows xmlOut.WriteStartElement("DockWindows"); int dockWindowId = 0; foreach (DockWindow dw in dockPanel.DockWindows) { xmlOut.WriteStartElement("DockWindow"); xmlOut.WriteAttributeString("ID", dockWindowId.ToString(CultureInfo.InvariantCulture)); dockWindowId++; xmlOut.WriteAttributeString("DockState", dw.DockState.ToString()); xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteStartElement("NestedPanes"); xmlOut.WriteAttributeString("Count", dw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in dw.NestedPanes) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); NestedDockingStatus status = pane.NestedDockingStatus; xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // FloatWindows RectangleConverter rectConverter = new RectangleConverter(); xmlOut.WriteStartElement("FloatWindows"); xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString(CultureInfo.InvariantCulture)); foreach (FloatWindow fw in dockPanel.FloatWindows) { xmlOut.WriteStartElement("FloatWindow"); xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds)); xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteStartElement("NestedPanes"); xmlOut.WriteAttributeString("Count", fw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in fw.NestedPanes) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", fw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); NestedDockingStatus status = pane.NestedDockingStatus; xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // </FloatWindows> xmlOut.WriteEndElement(); if (!upstream) { xmlOut.WriteEndDocument(); xmlOut.Close(); } else { xmlOut.Flush(); } }
public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding) { XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding); // Use indenting for readability xmlOut.Formatting = Formatting.Indented; // Always begin file with identification and warning xmlOut.WriteStartDocument(); xmlOut.WriteComment(" DockPanel configuration file. Author: Weifen Luo, all rights reserved. "); xmlOut.WriteComment(" !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! "); // Associate a version number with the root element so that future version of the code // will be able to be backwards compatible or at least recognise out of date versions xmlOut.WriteStartElement("DockPanel"); xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion); xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString()); xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString()); // Contents xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString()); foreach (DockContent content in dockPanel.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString()); xmlOut.WriteAttributeString("PersistString", content.PersistString); xmlOut.WriteAttributeString("AutoHidePortion", content.AutoHidePortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("IsHidden", content.IsHidden.ToString()); xmlOut.WriteAttributeString("IsFloat", content.IsFloat.ToString()); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // Panes xmlOut.WriteStartElement("Panes"); xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString()); foreach (DockPane pane in dockPanel.Panes) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("DockState", pane.DockState.ToString()); xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString()); xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString()); foreach (DockContent content in pane.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString()); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // DockWindows xmlOut.WriteStartElement("DockWindows"); int count = 0; foreach (DockWindow dw in dockPanel.DockWindows) { if (dw.DockList.Count > 0) { count++; } } xmlOut.WriteAttributeString("Count", count.ToString()); int i = 0; foreach (DockWindow dw in dockPanel.DockWindows) { if (dw.DockList.Count == 0) { continue; } xmlOut.WriteStartElement("DockWindow"); xmlOut.WriteAttributeString("ID", i.ToString()); xmlOut.WriteAttributeString("DockState", dw.DockState.ToString()); xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString()); xmlOut.WriteStartElement("DockList"); xmlOut.WriteAttributeString("Count", dw.DockList.Count.ToString()); foreach (DockPane pane in dw.DockList) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dw.DockList.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString()); NestedDockingStatus status = pane.NestedDockingStatus; xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString()); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); i++; } xmlOut.WriteEndElement(); // FloatWindows RectangleConverter rectConverter = new RectangleConverter(); xmlOut.WriteStartElement("FloatWindows"); xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString()); foreach (FloatWindow fw in dockPanel.FloatWindows) { xmlOut.WriteStartElement("FloatWindow"); xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString()); xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds)); xmlOut.WriteAttributeString("AllowRedocking", fw.AllowRedocking.ToString()); xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString()); xmlOut.WriteStartElement("DockList"); xmlOut.WriteAttributeString("Count", fw.DockList.Count.ToString()); foreach (DockPane pane in fw.DockList) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", fw.DockList.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString()); NestedDockingStatus status = pane.NestedDockingStatus; xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString()); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // </FloatWindows> xmlOut.WriteEndElement(); xmlOut.WriteEndDocument(); // This should flush all actions and close the file xmlOut.Close(); }
private object ProcessGetValue(Type type, MemberInfo memInfo, object result) { if (type == typeof(string)) { if (memInfo == null) { return(result); } object[] olist = memInfo.GetCustomAttributes(XObjectHelper.XCDataAttributeType, false); if (olist == null || olist.Length < 1 || result == null) { return(result); } XCDataAttribute attr = olist[0] as XCDataAttribute; if (attr == null || attr.EnableCData == false) { return(result); } return("<![CDATA[" + result.ToString() + "]]>"); } if (type == typeof(Color)) { ColorConverter cc = new ColorConverter(); return(cc.ConvertToInvariantString(result)); } if (type == typeof(Font)) { FontConverter cc = new FontConverter(); return(cc.ConvertToInvariantString(result)); } if (type == typeof(Point)) { PointConverter cc = new PointConverter(); return(cc.ConvertToInvariantString(result)); } if (type == typeof(Rectangle)) { RectangleConverter cc = new RectangleConverter(); return(cc.ConvertToInvariantString(result)); } if (type == typeof(Size)) { SizeConverter cc = new SizeConverter(); return(cc.ConvertToInvariantString(result)); } //if (type == typeof(Type)) //{ // if (result == null) return ""; // return result.ToString(); //} if (!XObjectHelper.IsXBaseType(type)) { TypeConverter tc = TypeDescriptor.GetConverter(type); if (tc != null) { return(tc.ConvertToInvariantString(result)); } } return(result); }
public override string Serialize() { var rect = _regionProvider.SelectedRegion; return(RectangleConverter.ConvertToInvariantString(rect)); }
public static void SaveApplication(DockPanel dockPanel, XmlTextWriter xmlWriter) { // Associate a version number with the root element so that future version of the code // will be able to be backwards compatible or at least recognise out of date versions xmlWriter.WriteStartElement("DockPanel"); xmlWriter.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture)); if (!Win32Helper.IsRunningOnMono) { xmlWriter.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture)); } // Contents xmlWriter.WriteStartElement("Contents"); xmlWriter.WriteAttributeString("Count", dockPanel.Contents.Count.ToString(CultureInfo.InvariantCulture)); foreach (WorkItemDockContent content in dockPanel.Contents) { xmlWriter.WriteStartElement("Content"); xmlWriter.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString(CultureInfo.InvariantCulture)); content.Save(xmlWriter); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); // Panes xmlWriter.WriteStartElement("Panes"); xmlWriter.WriteAttributeString("Count", dockPanel.Panes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in dockPanel.Panes) { xmlWriter.WriteStartElement("Pane"); xmlWriter.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("DockState", pane.DockState.ToString()); xmlWriter.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteStartElement("Contents"); xmlWriter.WriteAttributeString("Count", pane.Contents.Count.ToString(CultureInfo.InvariantCulture)); foreach (IDockContent content in pane.Contents) { xmlWriter.WriteStartElement("Content"); xmlWriter.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); // DockWindows xmlWriter.WriteStartElement("DockWindows"); int dockWindowId = 0; foreach (DockWindow dw in dockPanel.DockWindows) { xmlWriter.WriteStartElement("DockWindow"); xmlWriter.WriteAttributeString("ID", dockWindowId.ToString(CultureInfo.InvariantCulture)); dockWindowId++; xmlWriter.WriteAttributeString("DockState", dw.DockState.ToString()); xmlWriter.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteStartElement("NestedPanes"); xmlWriter.WriteAttributeString("Count", dw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in dw.NestedPanes) { xmlWriter.WriteStartElement("Pane"); xmlWriter.WriteAttributeString("ID", dw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); NestedDockingStatus status = pane.NestedDockingStatus; xmlWriter.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlWriter.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); // FloatWindows var rectConverter = new RectangleConverter(); xmlWriter.WriteStartElement("FloatWindows"); xmlWriter.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString(CultureInfo.InvariantCulture)); foreach (FloatWindow fw in dockPanel.FloatWindows) { xmlWriter.WriteStartElement("FloatWindow"); xmlWriter.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds)); xmlWriter.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteStartElement("NestedPanes"); xmlWriter.WriteAttributeString("Count", fw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); foreach (DockPane pane in fw.NestedPanes) { xmlWriter.WriteStartElement("Pane"); xmlWriter.WriteAttributeString("ID", fw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); NestedDockingStatus status = pane.NestedDockingStatus; xmlWriter.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlWriter.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); // </FloatWindows> xmlWriter.WriteEndElement(); }