Beispiel #1
0
 public void Begin()
 {
     if (this.Source != null)
     {
         var engine = IncrementalPatternEngine.GetForContext(Context);
         engine.Patterns.Add(this);
         engine.Run();
     }
 }
 public static IncrementalPatternEngine GetForContext(ITransformationContext context)
 {
     if (context == null) throw new ArgumentNullException("context");
     if (context.Data == null) throw new ArgumentException("Data container not set", "context");
     object engine;
     if (context.Data.TryGetValue(_DataKey, out engine))
     {
         return engine as IncrementalPatternEngine;
     }
     else
     {
         IncrementalPatternEngine _engine = new IncrementalPatternEngine(context);
         context.Data.Add(_DataKey, _engine);
         return _engine;
     }
 }
Beispiel #3
0
        public static IncrementalPatternEngine GetForContext(ITransformationContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (context.Data == null)
            {
                throw new ArgumentException("Data container not set", "context");
            }
            object engine;

            if (context.Data.TryGetValue(_DataKey, out engine))
            {
                return(engine as IncrementalPatternEngine);
            }
            else
            {
                IncrementalPatternEngine _engine = new IncrementalPatternEngine(context);
                context.Data.Add(_DataKey, _engine);
                return(_engine);
            }
        }
Beispiel #4
0
 public void Finish()
 {
     IncrementalPatternEngine.GetForContext(Context).Patterns.Remove(this);
     Source.Dispose();
 }