public void Execute(object parameter) { switch (ruleEditorViewModel.RuleEditorInfo.RuleEditorType) { case RuleEditorType.CreateNewRule: RegexRule.Save ( ruleEditorViewModel.RuleEditorInfo.DocumentGuid, ruleEditorViewModel.StagingRule ); break; case RuleEditorType.EditingExistingRule: RegexRule.Update ( ruleEditorViewModel.RuleEditorInfo.DocumentGuid, ruleEditorViewModel.StagingRule ); break; case RuleEditorType.DuplicateExistingRule: RegexRule.Save ( ruleEditorViewModel.RuleEditorInfo.DocumentGuid, ruleEditorViewModel.StagingRule ); break; } }