public CompilationManager(IRazorDocument document, IRazorConfigurationService config) { _document = document; _config = config; _generationResults = Observable.Merge( _document.PropertyChanged.ForProperty(d => d.Text), _config.PropertyChanged.ForProperty(c => c.ActiveCompiler).Select(_ => _document.Text)) .Select(Compile); }
public TranslatedSourceModuleModel( ICompilationService compilationService, IDocumentService documentService, IRazorConfigurationService configService) { _compilationService = compilationService; _documentService = documentService; _configService = configService; _compilationManager = _compilationService.CreateCompilationManager(_documentService.ActiveDocument); _generatedCode = this.ObservableToProperty( _compilationManager.GenerationResults.Select(r => r.Code), vm => vm.GeneratedCode); }
public ParseTreeDisplayModuleModel( ICompilationService compilationService, IDocumentService documentService, IRazorConfigurationService configService) { _compilationService = compilationService; _documentService = documentService; _configService = configService; _compilationManager = _compilationService.CreateCompilationManager(_documentService.ActiveDocument); _tree = this.ObservableToProperty( _compilationManager.GenerationResults.Select(r => new [] { new BlockViewModel(r.Document) }), vm => vm.Tree); }
public ConfigurationToolbarModuleModel( IRazorConfigurationService configService) { _configService = configService; MultiEngine = Engines.Count() > 1; SingleEngine = Engines.Count() == 1; _configService.PropertyChanged .ForProperty(c => c.AvailableLanguages) .Subscribe(_ => raisePropertyChanged("Languages")); _configService.PropertyChanged .ForProperty(c => c.AvailableEngines) .Subscribe(_ => raisePropertyChanged("Engines")); _configService.PropertyChanged .ForProperty(c => c.ActiveLanguage) .Subscribe(_ => raisePropertyChanged("SelectedLanguage")); _configService.PropertyChanged .ForProperty(c => c.ActiveEngine) .Subscribe(_ => raisePropertyChanged("SelectedEngine")); _configService.PropertyChanged .ForProperty(c => c.DesignTimeMode) .Subscribe(_ => raisePropertyChanged("DesignTimeMode")); string copyright = typeof(ConfigurationToolbarModule).Assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright; About = new ReactiveCommand(); About.Subscribe(_ => { MessageBox.Show("RazorSpy is " + copyright + ".\r\n" + "Licensed under the Apache Public License\r\n" + "\r\n" + "This project uses the following icons from The Noun Project (http://thenounproject.com)\r\n" + " * \"Zoom In\", by Octopod from The Noun Project (http://thenounproject.com/noun/zoom/#icon-No1669)\r\n" + " * \"At\", Public Domain (http://thenounproject.com/noun/at/#icon-No98)\r\n" + "As well as icons from the SyncFusion Metro Studio set (http://www.syncfusion.com/downloads/metrostudio)", "About RazorSpy", MessageBoxButton.OK, MessageBoxImage.Information); }); }
public CompilationService(IRazorConfigurationService config) { _config = config; }
public SingleDocumentService(IRazorConfigurationService configService) { _configService = configService; }