public void Export(ExportOptions options) { foreach (FavoriteConfigurationElement favorite in options.Favorites) { if (options.Favorites.Count > 1) { string fileNameWithSuffix = AddFileNameSuffix(favorite.Name, options.FileName); ExportFavorite(fileNameWithSuffix, favorite); } else ExportFavorite(options.FileName, favorite); } }
public void Export(ExportOptions options) { try { XDocument doc = new XDocument(new XElement("servers")); ExportFavorites(doc, options.Favorites); doc.Save(options.FileName); } catch (Exception exception) { Log.Error("Export to ExtraLogicAndroidRd failed.", exception); } }
private void RunExport() { List<FavoriteConfigurationElement> favorites = this.FindSelectedFavorites(); // filter index is 1 based int filterSplitIndex = (this.saveFileDialog.FilterIndex - 1)*2; string providerFilter = this.saveFileDialog.Filter.Split('|')[filterSplitIndex]; ExportOptions options = new ExportOptions { ProviderFilter = providerFilter, Favorites = favorites, FileName = this.saveFileDialog.FileName, IncludePasswords = this.checkBox1.Checked }; Integrations.Exporters.Export(options); }
public void Export(ExportOptions options) { try { using (XmlTextWriter w = new XmlTextWriter(options.FileName, Encoding.Unicode)) { w.WriteStartDocument(); w.WriteStartElement("favorites"); foreach (FavoriteConfigurationElement favorite in options.Favorites) { WriteFavorite(w, options.IncludePasswords, favorite); } w.WriteEndElement(); w.WriteEndDocument(); w.Flush(); w.Close(); } } catch (Exception ex) { Log.Error("Export to XML failed.", ex); } }