public OptionsViewModel() { _options = new Options(); AllowDeletionOfVertices = _options.AllowDeletionOfVertices; AllowModificationsOfExpressions = _options.AllowModificationOfExpressions; UseGlobalBlockingSemantics = _options.UseGlobalBlockingSemantics; // Map policytable into wpf bindable datastructure foreach (var keyValuePair in _options.PolicyTable) { OptionsGroup group = new OptionsGroup { Change = keyValuePair.Key }; foreach (var valuePair in keyValuePair.Value) { @group.Options.Add(new Option { Type = valuePair.Key, Policy = valuePair.Value }); } _groups.Add(group); } OnRepairClick = new RelayCommand(() => { UpdateOptionsValues(); SwitchToRepair(); }); }
public void OptionsGroup_NoOptions() { var regex = RegularExpression.Of( OptionsGroup.Of(GroupRegexOptions.None, GroupRegexOptions.None, Literal.For("A")) ).ToRegex(); Assert.AreEqual("(?:A)", regex.ToString()); }
public void OptionsGroup_EnableOnly() { var enabled = GroupRegexOptions.IgnoreCase | GroupRegexOptions.Multiline | GroupRegexOptions.ExplicitCapture | GroupRegexOptions.IgnorePatternWhitespace; var regex = RegularExpression.Of( OptionsGroup.Of(enabled, GroupRegexOptions.None, Literal.For("A")) ).ToRegex(); Assert.AreEqual("(?imnx:A)", regex.ToString()); }