Пример #1
0
        private void Compile()
        {
            if (DataContext == null)
            {
                throw ExceptionBuilder.PropertyNotInitialized("DataContext");
            }

            if (Text == null || Text.Length == 0)
            {
                throw ExceptionBuilder.PropertyNotInitialized("Text");
            }

            // Compile query

            ClearCompiledState();
            Compiler compiler = new Compiler(_errorCollector);

            _resultAlgebraNode = compiler.CompileQuery(Text, Scope);

            if (_errorCollector.ErrorsSeen)
            {
                IList <CompilationError> errors = _errorCollector.GetErrors();
                OnCompilationFailed(new CompilationFailedEventArgs(errors));
                throw ExceptionBuilder.QueryCompilationFailed(errors);
            }

            OnCompilationSucceeded(EventArgs.Empty);
            _resultIterator = IteratorCreator.Convert(DataContext.MetadataContext, true, _resultAlgebraNode);
        }
Пример #2
0
 //constructor
 public Itermediary(IteratorCreator songIterator)
 {
     this.songIterator = songIterator;
     example           = new ObservableCollection <Song>();
 }