private void btnBrowse_Click(object sender, EventArgs e) { if (syncUtility != null) { string InitialbasePath = Directory.GetCurrentDirectory(); string CurrentbasePath = string.Empty; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CurrentbasePath = Directory.GetCurrentDirectory(); string fileToOpen = openFileDialog.FileName; string fileExtension = fileToOpen.Substring(fileToOpen.LastIndexOf('.') + 1); if (fileExtension.ToUpper() != "MDB2") { MessageBox.Show("Please select the file with Mdb2 extension"); return; } txtMdbName.Text = fileToOpen; syncUtility.UpdateMdbFile(fileToOpen); } if (InitialbasePath != CurrentbasePath) // In XP both path would be different. { Directory.SetCurrentDirectory(InitialbasePath); } } else { MessageBox.Show("Please select the scope first."); } }
public int InitializeConsoleSPRutility(string projectName, string fileToOpen, string lstComponents) { try { syncUtility = new SPRSynchronizationUtility(logFile, projectName, "SPRUtil"); syncUtility.UpdateMdbFile(fileToOpen); List <string> lstitems; if (lstComponents.Contains(',')) { string[] arr = lstComponents.Split(','); lstitems = new List <string>(arr); } else { lstitems = new List <string>(); lstitems.Add(lstComponents); } syncUtility.MDBSynchronization(lstitems); SaveLoggingFile(); return(0); } catch (Exception ex) { logFile.WriteLine("Please check the parameters : " + ex.Message); return(1); } }
public int InitializeConsoleSPRutility(string projectName, string fileToOpen, string lstComponents) { try { syncUtility = new SPRSynchronizationUtility(logFile, projectName, "SPRUtil"); syncUtility.UpdateMdbFile(fileToOpen); List<string> lstitems; if (lstComponents.Contains(',')) { string[] arr = lstComponents.Split(','); lstitems = new List<string>(arr); } else { lstitems = new List<string>(); lstitems.Add(lstComponents); } syncUtility.MDBSynchronization(lstitems); SaveLoggingFile(); return 0; } catch (Exception ex) { logFile.WriteLine("Please check the parameters : " + ex.Message); return 1; } }