static void Main(string[] args) { //http://blog.danskingdom.com/adding-and-accessing-custom-sections-in-your-c-app-config/ /* * var syncsource = ConfigurationManager.GetSection("SyncSource") as NameValueCollection; * if (syncsource != null) * { * foreach (string key in syncsource) * { * Console.WriteLine(syncsource[key].ToString()); * } * } */ ISyncBusiness syncbusiness = new SyncBusiness( FileRepositoryFactory((NameValueCollection)ConfigurationManager.GetSection("SyncSource")), FileRepositoryFactory((NameValueCollection)ConfigurationManager.GetSection("SyncDestination")) ); var result = syncbusiness.Sync(); Console.WriteLine("Folder:" + result.Folder); Console.WriteLine("File:" + result.File); Console.Read(); }
public void WinToWinTest() { _source = new WindowsFileRepository(@"D:\CodeProject\SyncFile\temp1"); _destination = new WindowsFileRepository(@"D:\CodeProject\SyncFile\temp2"); ISyncBusiness isyncbusiness = new SyncBusiness(_source, _destination); isyncbusiness.Sync(); }
public void WinToTrelloTest() { _source = new WindowsFileRepository(@"D:\CodeProject\SyncFile\temp1"); _destination = new TrelloFileRepository( ConfigurationManager.AppSettings["key"], ConfigurationManager.AppSettings["token"], ConfigurationManager.AppSettings["list"] ); ISyncBusiness isyncbusiness = new SyncBusiness(_source, _destination); isyncbusiness.Sync(); }
private void ExportButton_Click(object sender, RoutedEventArgs e) { SaveFileDialog SaveDlg = new SaveFileDialog(); SaveDlg.OverwritePrompt = true; SaveDlg.DefaultExt = ".xml"; SaveDlg.Filter = "Xml Files|*.xml"; if (SaveDlg.ShowDialog() == true) { SyncBusiness Export = new SyncBusiness(); Export.ExportToFile(SelectedItems.Select(v => v.MediaId.Value).ToList(), SaveDlg.FileName); MessageBox.Show("Export completed", "Result"); this.Close(); } }