private static void handleCommandLine(string[] args) { String command = args[0]; String filename = args[1]; if (command.Contains("r")) { renameObject obj = new renameObject(filename); obj.rename(); } }
void onRenameDone(renameObject ren) { if (this.InvokeRequired) { this.Invoke(new RenameDone(onRenameDone), ren); return; } progressLayout.Controls.Remove(ren.progress); this.resizeAndMove(); ren.progress.Dispose(); ren.progress = null; }
private void createRenameThread(string file, bool copy, bool locally) { renameObject tmp = new renameObject(file); tmp.copyFile = copy; tmp.localRename = locally; tmp.progress = attachProgressBar(); tmp.progress.MouseHover += new EventHandler(tmp.progressHover); tmp.RenameDone += new RenameDone(onRenameDone); this.resizeAndMove(); Thread renameThread = new Thread(new ThreadStart(tmp.rename)); renameThread.Start(); }