private StepBindingNew CreateStepBinding(CodeAttribute2 attr, CodeFunction codeFunction, BindingType bindingType, BindingScopeNew bindingScope) { try { IBindingMethod bindingMethod = new VsBindingMethod(codeFunction); var regexArg = attr.Arguments.Cast <CodeAttributeArgument>().FirstOrDefault(); if (regexArg == null) { return(null); } var regexString = VsxHelper.ParseCodeStringValue(regexArg.Value, regexArg.Language); var regex = new Regex("^" + regexString + "$", RegexOptions.Compiled | RegexOptions.CultureInvariant); return(new StepBindingNew(bindingMethod, bindingType, regex, bindingScope)); } catch (Exception) { return(null); } }
private StepBindingNew CreateStepBinding(CodeAttribute2 attr, CodeFunction codeFunction, BindingType bindingType, BindingScopeNew bindingScope) { try { IBindingMethod bindingMethod = new VsBindingMethod(codeFunction); var regexArg = attr.Arguments.Cast<CodeAttributeArgument>().FirstOrDefault(); if (regexArg == null) return null; var regexString = VsxHelper.ParseCodeStringValue(regexArg.Value, regexArg.Language); var regex = new Regex("^" + regexString + "$", RegexOptions.Compiled | RegexOptions.CultureInvariant); return new StepBindingNew(bindingMethod, bindingType, regex, bindingScope); } catch(Exception) { return null; } }