Ejemplo n.º 1
0
        // save the layout
        private void DockManager_Unloaded(object sender, RoutedEventArgs e)
        {
            var serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(dockManager);

            serializer.Serialize(layoutXmlFile);
            Debug.WriteLine($">> Layout saved to {layoutXmlFile}");
        }
Ejemplo n.º 2
0
        private void Manager_Unloaded(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("Serialize the layout...");
            var serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(this.Manager);

            serializer.Serialize(layoutXmlFile);
        }
Ejemplo n.º 3
0
        private void MainWindow_Closed(object sender, EventArgs e)
        {
            // save off the dockmanager layout

            string dockManagerLayoutName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\SMT\\" + SMT_VERSION + "\\Layout.dat";

            try
            {
                AvalonDock.Layout.Serialization.XmlLayoutSerializer ls = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(dockManager);
                using (var sw = new StreamWriter(dockManagerLayoutName))
                {
                    ls.Serialize(sw);
                }
            }
            catch
            {
            }

            try
            {
                // Save off any explicit items
                MapConf.UseESIForCharacterPositions = EVEManager.UseESIForCharacterPositions;

                // Save the Map Colours
                string mapConfigFileName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\SMT\\" + SMT_VERSION + "\\MapConfig.dat";

                // now serialise the class to disk
                XmlSerializer xms = new XmlSerializer(typeof(MapConfig));
                using (TextWriter tw = new StreamWriter(mapConfigFileName))
                {
                    xms.Serialize(tw, MapConf);
                }
            }
            catch
            {
            }

            try
            {
                // save the Anom Data
                // now serialise the class to disk
                XmlSerializer anomxms          = new XmlSerializer(typeof(EVEData.AnomManager));
                string        anomDataFilename = EVEManager.SaveDataVersionFolder + @"\Anoms.dat";

                using (TextWriter tw = new StreamWriter(anomDataFilename))
                {
                    anomxms.Serialize(tw, ANOMManager);
                }
            }
            catch
            {
            }

            // save the character data
            EVEManager.SaveData();
            EVEManager.ShutDown();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Convert layout data to a string from this DockingManager
        /// </summary>
        /// <param name="dockManager">Source DockingManager</param>
        /// <returns>Converted string of layout data</returns>
        public static string LayoutToString(this DockingManager dockManager)
        {
            StringBuilder sb         = new StringBuilder();
            StringWriter  sw         = new StringWriter(sb);
            var           serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(dockManager);

            serializer.Serialize(sw);
            return(sb.ToString());
        }
Ejemplo n.º 5
0
        private void SaveDockingLayout()
        {
            var serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(
                dockingManager);

            using (var stream = System.IO.File.Create("AvalonLayoutConfig.xml"))
            {
                serializer.Serialize(stream);
            }
        }
        //--------------------------------------------------------------------------------------------------

        void _SaveWindowLayout(string name)
        {
            // Save window layout
            var directory = System.IO.Path.Combine(AppContext.Current.LocalAppDataDirectory, "WindowLayouts");

            Directory.CreateDirectory(directory);
            var serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(DockingManager);

            serializer.Serialize(System.IO.Path.Combine(directory, $"{name}.xml"));
        }
Ejemplo n.º 7
0
        public static void SaveLayout(this DockingManager dockingManager)
        {
            var layoutFile   = ApplicationPaths.AvalonDockLayoutFile;
            var layoutFolder = Path.GetDirectoryName(layoutFile);

            Directory.CreateDirectory(layoutFolder); //ensure that all the folders in the file path exist
            using (StreamWriter sw = new StreamWriter(layoutFile))
            {
                var ls = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(dockingManager);
                ls.Serialize(sw);
            }
        }
Ejemplo n.º 8
0
 private void SaveDockingLayout()
 {
     var serializer = new AvalonDock.Layout.Serialization.XmlLayoutSerializer(
         dockingManager);
     using (var stream = System.IO.File.Create("AvalonLayoutConfig.xml"))
     {
         serializer.Serialize(stream);
     }
 }