ScanMaster.ProfileManager.SaveProfileSetAsXml C# (CSharp) Method

SaveProfileSetAsXml() public method

public SaveProfileSetAsXml ( FileStream stream ) : void
stream System.IO.FileStream
return void
        public void SaveProfileSetAsXml(FileStream stream)
        {
            // save the settings; xml format
            XmlSerializer s = new XmlSerializer(typeof(ProfileSet));
            ProfileSet ps = new ProfileSet();
            ps.Profiles = this.Profiles;
            s.Serialize(stream, ps);
        }

Usage Example

Example #1
0
        public void SaveProfileSet()
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Filter           = "xml profile set|*.xml";
            dialog.Title            = "Save profile set";
            dialog.InitialDirectory = Environs.FileSystem.Paths["settingsPath"] + "ScanMaster";
            dialog.ShowDialog();
            if (dialog.FileName != "")
            {
                System.IO.FileStream fs =
                    (System.IO.FileStream)dialog.OpenFile();
                profileManager.SaveProfileSetAsXml(fs);
                fs.Close();
                UpdateWindowTitle(dialog.FileName);
            }
        }