public static void Export(string svnFileUrl, uint pegRevision, string targetPath, bool force = false, bool ignore_externals = false, bool ignore_keywords = false) { if (String.IsNullOrEmpty(svnFileUrl)) { throw new Exception("svnFileUrl is empty"); } if (pegRevision == 0) { throw new Exception("pegRevision is 0"); } if (String.IsNullOrEmpty(targetPath)) { throw new Exception("targetPath is empty"); } string fileAtPegRevision = String.Format("{0}@{1}", svnFileUrl, pegRevision); BridgeCliOpt opt = new BridgeCliOpt { force = Convert.ToInt32(force), ignore_externals = Convert.ToInt32(ignore_externals), ignore_keywords = Convert.ToInt32(ignore_keywords) }; ExportCmd cmd = new ExportCmd(); IntPtr source = NativeStringHelper.StringToNativeUtf8(fileAtPegRevision); IntPtr to = NativeStringHelper.StringToNativeUtf8(targetPath); cmd.Run(source, to, opt); }
private static async Task HandleExport(IServiceProvider services, ExportCmd opts) { await services.GetRequiredService <FlatFileExport>().Run(new FlatFileExport.ExportOptions { OutDir = opts.Directory, Compress = opts.Compress }); }
private void btnCreateCommand_Click(object sender, EventArgs e) { // add a new command ExportCmd exportCmd = new ExportCmd(); if (config.ExportCmds.Count > 0) { exportCmd.CmdNum = config.ExportCmds[config.ExportCmds.Count - 1].CmdNum + 1; } config.ExportCmds.Add(exportCmd); cbCommand.SelectedIndex = cbCommand.Items.Add(exportCmd); Modified = true; }
/// <summary> /// Sort and update the command list. /// </summary> private void UpdateCommands() { try { cbCommand.BeginUpdate(); config.ExportCmds.Sort(); ExportCmd selectedCmd = cbCommand.SelectedItem as ExportCmd; cbCommand.Items.Clear(); cbCommand.Items.AddRange(config.ExportCmds.ToArray()); cbCommand.SelectedIndex = config.ExportCmds.IndexOf(selectedCmd); } finally { cbCommand.EndUpdate(); } }
/// <summary> /// Shows the command parameters. /// </summary> private void ShowCommandParams(ExportCmd exportCmd) { if (exportCmd == null) { gbCommandParams.Enabled = false; numCmdNum.Value = numCmdNum.Minimum; txtName.Text = ""; txtCmdQuery.Text = ""; } else { gbCommandParams.Enabled = true; numCmdNum.SetValue(exportCmd.CmdNum); txtName.Text = exportCmd.Name; txtCmdQuery.Text = exportCmd.Query; } }