private void ExecutePreviewKeyDown(KeyEventArgs kea) { if (kea.Key == Key.Enter && _unfrozenText.Length > 0) { bool add = true; foreach (var fe in FilterCriteria) { if (fe.FrozenText.Equals(_unfrozenText)) { add = false; } } if (add) { FilterCriteria.Add(new FilterCriteriaVM(_unfrozenText, _filterCritera)); } UnfrozenText = ""; } else if (kea.Key == Key.Back && CaretPosition == 0) { if (FilterCriteria.Any()) { FilterCriteriaVM fe = FilterCriteria[FilterCriteria.Count() - 1]; FilterCriteria.RemoveAt(FilterCriteria.Count() - 1); UnfrozenText = fe.FrozenText + _unfrozenText; CaretPosition = _unfrozenText.Length; } } }
#pragma warning disable S1541 // Methods and properties should not be too complex #pragma warning disable S3776 // Cognitive Complexity of methods should not be too high void AddInputDebug(IExecutionEnvironment env, int update) #pragma warning restore S3776 // Cognitive Complexity of methods should not be too high #pragma warning restore S1541 // Methods and properties should not be too complex { var validItems = SharepointUtils.GetValidReadListItems(ReadListItems).ToList(); foreach (var varDebug in validItems) { var debugItem = new DebugItem(); AddDebugItem(new DebugItemStaticDataParams("", _indexCounter.ToString(CultureInfo.InvariantCulture)), debugItem); var variableName = varDebug.VariableName; if (!string.IsNullOrEmpty(variableName)) { AddDebugItem(new DebugEvalResult(variableName, "Variable", env, update), debugItem); AddDebugItem(new DebugItemStaticDataParams(varDebug.FieldName, "Field Name"), debugItem); } _indexCounter++; _debugInputs.Add(debugItem); } if (FilterCriteria != null && FilterCriteria.Any()) { var requireAllCriteriaToMatch = RequireAllCriteriaToMatch ? "Yes" : "No"; foreach (var varDebug in FilterCriteria) { if (string.IsNullOrEmpty(varDebug.FieldName)) { return; } var debugItem = new DebugItem(); AddDebugItem(new DebugItemStaticDataParams("", _indexCounter.ToString(CultureInfo.InvariantCulture)), debugItem); var fieldName = varDebug.FieldName; if (!string.IsNullOrEmpty(fieldName)) { AddDebugItem(new DebugEvalResult(fieldName, "Field Name", env, update), debugItem); } var searchType = varDebug.SearchType; if (!string.IsNullOrEmpty(searchType)) { AddDebugItem(new DebugEvalResult(searchType, "Search Type", env, update), debugItem); } var valueToMatch = varDebug.ValueToMatch; if (!string.IsNullOrEmpty(valueToMatch)) { AddDebugItem(new DebugEvalResult(valueToMatch, "Value", env, update), debugItem); } AddDebugItem(new DebugEvalResult(requireAllCriteriaToMatch, "Require All Criteria To Match", env, update), debugItem); _indexCounter++; _debugInputs.Add(debugItem); } } }
void AddInputDebug(IExecutionEnvironment env, int update) { var validItems = _sharepointUtils.GetValidReadListItems(ReadListItems).ToList(); foreach (var varDebug in validItems) { DebugItem debugItem = new DebugItem(); AddDebugItem(new DebugItemStaticDataParams("", _indexCounter.ToString(CultureInfo.InvariantCulture)), debugItem); var variableName = varDebug.VariableName; if (!string.IsNullOrEmpty(variableName)) { AddDebugItem(new DebugItemStaticDataParams(varDebug.FieldName, "Field Name"), debugItem); AddDebugItem(new DebugEvalResult(variableName, "Variable", env, update), debugItem); } _indexCounter++; _debugInputs.Add(debugItem); } if (FilterCriteria != null && FilterCriteria.Any()) { string requireAllCriteriaToMatch = RequireAllCriteriaToMatch ? "Yes" : "No"; foreach (var varDebug in FilterCriteria) { if (string.IsNullOrEmpty(varDebug.FieldName)) { return; } DebugItem debugItem = new DebugItem(); AddDebugItem(new DebugItemStaticDataParams("", _indexCounter.ToString(CultureInfo.InvariantCulture)), debugItem); var fieldName = varDebug.FieldName; if (!string.IsNullOrEmpty(fieldName)) { AddDebugItem(new DebugEvalResult(fieldName, "Field Name", env, update), debugItem); //AddDebugItem(new DebugItemStaticDataParams(varDebug.FieldName, "Field Name"), debugItem); } var searchType = varDebug.SearchType; if (!string.IsNullOrEmpty(searchType)) { AddDebugItem(new DebugEvalResult(searchType, "Search Type", env, update), debugItem); } var valueToMatch = varDebug.ValueToMatch; if (!string.IsNullOrEmpty(valueToMatch)) { AddDebugItem(new DebugEvalResult(valueToMatch, "Value", env, update), debugItem); } AddDebugItem(new DebugEvalResult(requireAllCriteriaToMatch, "Require All Criteria To Match", env, update), debugItem); _indexCounter++; _debugInputs.Add(debugItem); } } }