Seal.Model.OutputEmailDevice.SaveToFile C# (CSharp) Method

SaveToFile() public method

public SaveToFile ( string path ) : void
path string
return void
        public override void SaveToFile(string path)
        {
            //Check last modification
            if (LastModification != DateTime.MinValue && File.Exists(path))
            {
                DateTime lastDateTime = File.GetLastWriteTime(path);
                if (LastModification != lastDateTime)
                {
                    throw new Exception("Unable to save the Output Device file. The file has been modified by another user.");
                }
            }

            Name = Path.GetFileNameWithoutExtension(path);
            XmlSerializer serializer = new XmlSerializer(typeof(OutputEmailDevice));
            StreamWriter sw = new StreamWriter(path);
            serializer.Serialize(sw, (OutputEmailDevice)this);
            sw.Close();
            FilePath = path;
            LastModification = File.GetLastWriteTime(path);
        }

Same methods

OutputEmailDevice::SaveToFile ( ) : void