public static bool IsSegmentWithComments(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (!rowInfo.IsSegment) { return(false); } var success = settings.SegmentReviewTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.SegmentReviewType.WithComments.ToString() , StringComparison.OrdinalIgnoreCase) == 0); var visitor = new CommentDataVisitor(); // check if comments exist in the target segment if (success && !visitor.GetComments(rowInfo.SegmentPair.Target).Any()) { // check if comments exit in the source segment if (!visitor.GetComments(rowInfo.SegmentPair.Source).Any()) { success = false; } } return(success); }
public static bool IsOriginTypeFound(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (!rowInfo.IsSegment) { return(false); } var success = false; var translationType = rowInfo.SegmentPair.GetOriginType(); if (!IsCompoundOriginType(translationType) && settings.OriginTypes.ToList().Any(status => string.Compare(status, translationType.ToString(), StringComparison.OrdinalIgnoreCase) == 0)) { success = true; } if (!success) { success = rowInfo.IsFuzzyMatchRepairOriginTypeFound(settings); } if (!success) { success = rowInfo.IsEditedFuzzyMatchFound(settings); } if (!success) { success = rowInfo.IsUnEditedFuzzyMatchFound(settings); } return(success); }
public DisplayFilter(DisplayFilterSettings settings, CustomFilterSettings customSettings, Document document) { ActiveDocument = document; Settings = settings; CustomSettings = customSettings; }
public static bool IsUniqueRepetition(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (!rowInfo.IsSegment) { return(false); } if (settings.RepetitionTypes.Any(a => a == DisplayFilterSettings.RepetitionType.UniqueOccurrences.ToString())) { var isFirst = rowInfo.IsRepetitionsFirstOccurrences(new DisplayFilterSettings { RepetitionTypes = new List <string> { DisplayFilterSettings.RepetitionType.FirstOccurrences.ToString() } }); if (isFirst) { return(true); } if (rowInfo.SegmentPair.Properties.TranslationOrigin != null) { var isRepeated = rowInfo.SegmentPair.Properties.TranslationOrigin.IsRepeated; return(!isRepeated); } } return(false); }
public static bool IsSegmentLockingTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.IsSegmentLockingTypeLocked(settings) || rowInfo.IsSegmentLockingTypeUnLocked(settings); return(success); }
private static bool AreBothSourceAndTargetTrackedSelected(DisplayFilterSettings settings) { var hasSourceTrackedChangesSelected = HasReviewTypeSelected(DisplayFilterSettings.SegmentReviewType.WithSourceTrackedChanges.ToString(), settings.SegmentReviewTypes); var hasTargetTrackedChangesSelected = HasReviewTypeSelected(DisplayFilterSettings.SegmentReviewType.WithTargetTrackedChanges.ToString(), settings.SegmentReviewTypes); return(hasSourceTrackedChangesSelected && hasTargetTrackedChangesSelected); }
public static bool IsSegmentContentTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.IsSegmentContentTypeNumbersOnly(settings) || rowInfo.IsSegmentContentTypeExcludingNumberOnly(settings); return(success); }
public DisplayFilter(DisplayFilterSettings settings, CustomFilterSettings customSettings, bool reverseSearch, Document document) { ActiveDocument = document; Settings = settings; CustomSettings = customSettings; ReverseSearch = reverseSearch; }
public static bool IsSegmentReviewTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.IsSegmentWithTQAs(settings) || rowInfo.IsSegmentWithTrackedChanges(settings) || rowInfo.IsSegmentWithComments(settings) || rowInfo.IsSegmentWithMessages(settings); return(success); }
public static bool IsRepetitionTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.IsRepetitionsAll(settings) || rowInfo.IsRepetitionsFirstOccurrences(settings) || rowInfo.IsRepetitionsExcludingFirstOccurrences(settings); return(success); }
public static bool IsConfirmationLevelFound(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.ConfirmationLevels.ToList().Any(status => string.Compare(status , rowInfo.SegmentPair.Properties.ConfirmationLevel.ToString() , StringComparison.OrdinalIgnoreCase) == 0); return(success); }
public static bool IsTextFoundInTarget(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var text = rowInfo.SegmentPair.Target.GetString(true); var success = settings.IsRegularExpression ? RegularExpressionMatch(settings.TargetText, text, settings.IsCaseSensitive) : StringMatch(settings.TargetText, text, settings.IsCaseSensitive); return(success); }
public static bool IsOriginTypeFound(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var translationType = rowInfo.SegmentPair.GetOriginType(); var success = settings.OriginTypes.ToList() .Any(status => string.Compare(status, translationType.ToString() , StringComparison.OrdinalIgnoreCase) == 0); return(success); }
public static bool IsSegmentWithTQAs(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.SegmentReviewTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.SegmentReviewType.WithTQA.ToString() , StringComparison.OrdinalIgnoreCase) == 0); if (success && !rowInfo.ContainsTQAs) { success = false; } return(success); }
public static bool IsRepetitionsAll(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.RepetitionTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.RepetitionType.All.ToString() , StringComparison.OrdinalIgnoreCase) == 0); if (success) { success = rowInfo.SegmentPair.Properties.TranslationOrigin.IsRepeated; } return(success); }
public static bool IsSegmentContentTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.SegmentContentTypes?[0] == DisplayFilterSettings.SegmentContentType.NumbersOnly.ToString() && rowInfo.IsSegmentContentTypeNumbersOnly(settings); if (!success && settings.SegmentContentTypes?[0] == DisplayFilterSettings.SegmentContentType.ExcludeNumberOnly.ToString() && rowInfo.IsSegmentContentTypeExcludingNumberOnly(settings)) { success = true; } return(success); }
public static bool IsTextFoundInComment(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.SegmentPair.Target.GetComments() .Any(comment => StringMatch(settings.CommentText, comment.Text, false)); if (!success) { success = rowInfo.SegmentPair.Source.GetComments() .Any(comment => StringMatch(settings.CommentText, comment.Text, false)); } return(success); }
public static bool IsSegmentContentTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (settings.SegmentContentTypes?[0] == "NumbersOnly") { return(rowInfo.IsSegmentContentTypeNumbersOnly(settings)); } if (settings.SegmentContentTypes?[0] == "ExcludeNumberOnly") { return(rowInfo.IsSegmentContentTypeExcludingNumberOnly(settings)); } return(true); }
public static bool IsSegmentLockingTypeLocked(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.SegmentLockingTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.SegmentLockingType.Locked.ToString() , StringComparison.OrdinalIgnoreCase) == 0); if (success) { success = rowInfo.SegmentPair.Properties.IsLocked; } return(success); }
public static bool IsSeverityFoundInComment(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = rowInfo.SegmentPair.Target.GetComments() .Any(comment => settings.CommentSeverity == (int)comment.Severity); if (!success) { success = rowInfo.SegmentPair.Source.GetComments() .Any(comment => settings.CommentSeverity == (int)comment.Severity); } return(success); }
public static bool IsRepetitionsExcludingFirstOccurrences(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.RepetitionTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.RepetitionType.ExcludeFirstOccurrences.ToString() , StringComparison.OrdinalIgnoreCase) == 0); if (success) { success = rowInfo.RepetitionExcludeFirstOccurrence; } return(success); }
public static bool IsTextFoundInSource(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (!rowInfo.IsSegment) { return(false); } var text = rowInfo.SegmentPair.Source.GetString(true); var success = settings.IsRegularExpression ? RegularExpressionMatch(settings.SourceText, text, settings.IsCaseSensitive) : StringMatch(settings.SourceText, text, settings.IsCaseSensitive); return(success); }
public JsonResult DisplayJobOrderBalanceFill(Display_JobOrderBalanceViewModel vm) { DisplayFilterSettings SettingParameter = SetCurrentParameterSettings(vm); IEnumerable <JobOrderBalancelOrderNoWiseViewModel> JobOrderBalanceJobWorkerWise = _JobOrderBalanceService.JobOrderBalanceDetail(SettingParameter); if (JobOrderBalanceJobWorkerWise != null) { JsonResult json = Json(new { Success = true, Data = JobOrderBalanceJobWorkerWise.ToList() }, JsonRequestBehavior.AllowGet); json.MaxJsonLength = int.MaxValue; return(json); } return(Json(new { Success = true }, JsonRequestBehavior.AllowGet)); }
public static bool IsAuthorFoundInComment(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var visitor = new CommentDataVisitor(); var success = visitor.GetComments(rowInfo.SegmentPair.Target) .Any(comment => StringMatch(settings.CommentAuthor, comment.Author, false)); if (!success) { success = visitor.GetComments(rowInfo.SegmentPair.Source) .Any(comment => StringMatch(settings.CommentAuthor, comment.Author, false)); } return(success); }
public static bool IsContextInfoTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = false; if (rowInfo.ContextInfo.Count <= 0) { return(false); } if (rowInfo.ContextInfo.Any(contextInfo => settings.ContextInfoTypes.Contains(contextInfo.ContextType))) { success = true; } return(success); }
public static bool IsSegmentContentTypeNumbersOnly(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = settings.SegmentContentTypes.ToList() .Any(status => string.Compare(status, DisplayFilterSettings.SegmentContentType.NumbersOnly.ToString() , StringComparison.OrdinalIgnoreCase) == 0); if (success) { success = rowInfo.SegmentPair.Source.IsValidFloatingNumber(); if (!success) { success = rowInfo.SegmentPair.Target.IsValidFloatingNumber(); } } return(success); }
public static bool IsRepetitionTypes(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { if (!rowInfo.IsSegment) { return(false); } var success = rowInfo.IsRepetitionsAll(settings) || rowInfo.IsRepetitionsFirstOccurrences(settings) || rowInfo.IsRepetitionsExcludingFirstOccurrences(settings); if (!success) { success = rowInfo.IsUniqueRepetition(settings); } return(success); }
public static bool IsPreviousOriginTypeFound(this DisplayFilterRowInfo rowInfo, DisplayFilterSettings settings) { var success = false; if (rowInfo.SegmentPair.Properties.TranslationOrigin.OriginBeforeAdaptation != null) { var previousTranslationType = rowInfo.SegmentPair.GetPreviousTranslationOriginType(); if (settings.PreviousOriginTypes.ToList() .Any(status => string.Compare(status, previousTranslationType.ToString() , StringComparison.OrdinalIgnoreCase) == 0)) { success = true; } } return(success); }
public ContentMatchingService(DisplayFilterSettings settings, CustomFilterSettings customSettings) { _settings = settings; _customSettings = customSettings; }
public CustomFilterService(DisplayFilterSettings settings, CustomFilterSettings customSettings, Document document) { _settings = settings; _customSettings = customSettings; _document = document; }