void SaveLayout(LayoutProperties prop) { using (new WaitCursor()) { //var path = IOPath.Combine(Directory.GetCurrentDirectory(), Properties.Settings.Default.LayoutDir, CurrentLayout); //var fileName = IOPath.Combine(path, LayoutConfigFile); //if (!Directory.Exists(path)) //{ // MessageBox.Show("Layout with name " + MainWindow.CurrentLayout + " is not exists!", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk); // return; //} prop.Name = CurrentLayout; //?prop.ConfigFile = LayoutConfigFile; //prop.ImageBackground = BackgroundImage; //prop.Offset = MainWindow.instance.Vector2DLayoutOffset.ToPoint(); //prop.Size = MainWindow.instance.Vector2DLayoutSize.ToPoint(); prop.m_CaptionInfo = new List <CaptionInfo>(); prop.m_Table = new List <TableInfo>(); prop.m_GuideLineInfo = new List <GuideLineInfo>(); prop.m_CaptionInfo.AddRange(CaptionInfo.Convert(myCanvas.Children.OfType <TextSpan>().ToArray(), LayoutProperties.OffsetInPixel)); prop.m_Table.AddRange(TableInfo.Convert(myCanvas.Children.OfType <Table>().ToArray(), LayoutProperties.OffsetInPixel)); prop.m_GuideLineInfo.AddRange(GuideLineInfo.Convert(myCanvas.Children.OfType <GuideLine>().ToArray(), LayoutProperties.OffsetInPixel)); m_SupplementLayout.Save(); //prop.Save(fileName); } }
public void SaveLayout() { using (new WaitCursor()) { var mediaOffset = LayoutProperties.OffsetInPixel; //LayoutProperties.Name = CurrentLayoutName; LayoutProperties.m_CaptionInfo = new List <CaptionInfo>(); LayoutProperties.m_Table = new List <TableInfo>(); LayoutProperties.m_GuideLineInfo = new List <GuideLineInfo>(); LayoutProperties.m_ZSumbolInfo = new List <ZSumbolInfo>(); var count = myCanvas.Children.OfType <TextSpan>().ToArray(); LayoutProperties.m_CaptionInfo.AddRange(CaptionInfo.Convert(myCanvas.Children.OfType <TextSpan>().ToArray(), mediaOffset)); LayoutProperties.m_Table.AddRange(TableInfo.Convert(myCanvas.Children.OfType <Table>().ToArray(), mediaOffset)); LayoutProperties.m_GuideLineInfo.AddRange(GuideLineInfo.Convert(myCanvas.Children.OfType <GuideLine>().ToArray(), mediaOffset)); LayoutProperties.m_ZSumbolInfo.AddRange(ZSumbolInfo.Convert(myCanvas.Children.OfType <ZSumbol>().ToArray(), mediaOffset)); m_SupplementLayout.Save(); } }