public void put(Command o) { lock (mInputStack) { if (o == null) { Logger.putError ("Empty command in queue"); } mInputStack.Push (o); autoEvent.Set (); } }
public static Command create(ECommand command) { Command c = new Command (command); switch (command) { case ECommand.NOP: return c; case ECommand.END_STAGE: return c; default: Logger.putError ("Unknown command"); return null; } }
public static Command create(ECommand command, File file, File file2 = null) { Command c = new Command (command); switch (command) { case ECommand.SAME_MD5: c.file = file; return c; case ECommand.COPY_FILE: c.file = file; c.file2 = file2; return c; case ECommand.COPY_FOLDER: c.file = file; c.file2 = file2; return c; case ECommand.GET_MD5: c.file = file; c.file2 = file2; return c; default: Logger.putError ("Unknown command"); return null; } }
public static Command create(ECommand command, string path, string root = null) { Command c = new Command (command); switch (command) { case ECommand.BEGIN_FOLDER: c.file = new File (); c.file.path = File.removeParent (path, root); c.file.root = root; return c; case ECommand.NOCOMPARE_FOLDER: c.file = new File (); c.file.path = File.removeParent (path, root); c.file.root = root; return c; case ECommand.END_FOLDER: c.file = new File (); c.file.path = path; return c; case ECommand.CHECK_FILE: c.file = new File (path, root); return c; case ECommand.CHECK_FOLDER: c.file = new File (path, root); return c; case ECommand.REMOVE_ITEM: c.file = new File (path, root); return c; default: Logger.putError ("Unknown command"); return null; } }