public void RemoveTransformer(ValueTransformer transform) { if (_pipeline.Contains(transform)) { _pipeline.Remove(transform); } }
public ValueTransformerControl(ValueTransformer transformer) { InitializeComponent(); this.ValueTransformer = transformer; this.DataContext = transformer; if (ValueTransformer != null) { btnShowOptions.IsEnabled = ValueTransformer.HasOptions; } }
public void MoveTransformerDown(ValueTransformer transform) { if (_pipeline.Contains(transform)) { var index = _pipeline.IndexOf(transform); if (index < _pipeline.Count - 1) { _pipeline.Remove(transform); _pipeline.Insert(index + 1, transform); } } }
public void MoveTransformerUp(ValueTransformer transform) { if (_pipeline.Contains(transform)) { var index = _pipeline.IndexOf(transform); if (index > 0) { _pipeline.Remove(transform); _pipeline.Insert(index - 1, transform); } } }
public static ValueTransformer CreateTransform(String key, Object config = null) { ValueTransformer result = null; if (!String.IsNullOrEmpty(key)) { if (_registry.ContainsKey(key)) { // Create a new one from the type of the prototype in the registry result = Activator.CreateInstance(_registry[key].GetType()) as ValueTransformer; if (config != null) { result.RestoreFromConfiguration(config); } } } return(result); }
static void register(ValueTransformer prototype) { _registry.Add(prototype.Key, prototype); }
public void AddTransformer(ValueTransformer transform) { _pipeline.Add(transform); }