public AnnotateDeclarationViewModel( AnnotateDeclarationModel model, IEnumerable <IAnnotation> annotations, IAnnotationArgumentViewModelFactory argumentFactory ) : base(model) { _argumentFactory = argumentFactory; ApplicableAnnotations = AnnotationsForDeclaration(model.Target, annotations); AnnotationArguments = new ObservableViewModelCollection <IAnnotationArgumentViewModel>(); RefreshAnnotationArguments(Model.Annotation); AddAnnotationArgument = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteAddArgument, parameter => CanAddArgument); RemoveAnnotationArgument = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRemoveArgument, parameter => CanRemoveArgument); }
private AnnotateDeclarationViewModel TestViewModel(DeclarationType targetDeclarationType, IAnnotationArgumentViewModelFactory argumentFactory, IAnnotation initialAnnotation = null, bool localScope = false, bool initialAdjustAttribute = false) { var targetDeclaration = TestDeclaration(targetDeclarationType, localScope); var model = new AnnotateDeclarationModel(targetDeclaration, initialAnnotation); return(new AnnotateDeclarationViewModel(model, _testAnnotations, argumentFactory)); }