public bool SetFileLabel(string filePath, string outputFile, string labelId) { if (engine == null) { return(false); } try { FileHandler handler = engine.CreateFileHandler(filePath); handler.SetLabel(labelId, new LabelingOptions(AssignmentMethod.Privileged, string.Empty)); LateValue <bool> lateResult = new LateValue <bool>(); handler.CommitAsync(outputFile, lateResult); bool wasCommitted = lateResult.AwaitValue(); return(wasCommitted); } catch (Exception ex) { return(false); //throw; } }