/// <summary> /// Saves this process to a file /// </summary> /// <param name="file">The file to save this process to</param> /// <param name="name">The name of the process</param> public override void Save(string file, string name) { FdoBulkCopyTaskDefinition def = new FdoBulkCopyTaskDefinition(); def.name = name; List <FdoConnectionEntryElement> connList = new List <FdoConnectionEntryElement>(); List <FdoCopyTaskElement> copyTasks = new List <FdoCopyTaskElement>(); foreach (string connName in _options.ConnectionNames) { FdoConnection conn = _options.GetConnection(connName); FdoConnectionEntryElement entry = new FdoConnectionEntryElement(); entry.name = connName; entry.provider = conn.Provider; entry.ConnectionString = conn.ConnectionString; if (conn.HasConfiguration) { string path = Path.GetDirectoryName(file); path = Path.Combine(path, entry.name + "_configuration.xml"); conn.SaveConfiguration(path); entry.configPath = path; } connList.Add(entry); } foreach (FdoClassCopyOptions copt in _options.ClassCopyOptions) { copyTasks.Add(copt.ToElement()); } def.Connections = connList.ToArray(); def.CopyTasks = copyTasks.ToArray(); using (StreamWriter writer = new StreamWriter(file, false)) { XmlSerializer ser = new XmlSerializer(typeof(FdoBulkCopyTaskDefinition)); ser.Serialize(writer, def); } }