コード例 #1
0
ファイル: ExportRdp.cs プロジェクト: RSchwoerer/Terminals
 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);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
ファイル: ExportFrom.cs プロジェクト: RSchwoerer/Terminals
 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);
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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);
     }
 }