static ProcessorAPI() { Queue <Tuple <Type, Type> > postmappedProcessors = new Queue <Tuple <Type, Type> >(); var types = AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.GetTypes()).Where(p => p.IsSubclassOf(typeof(DataDescriber))); foreach (Type processor in types) { if (!(processor.GetCustomAttributes(typeof(ProcessorConfiguration), true).FirstOrDefault() is ProcessorConfiguration configAttribute)) { DataDescriber newProcessor = (DataDescriber)Activator.CreateInstance(processor); registeredProcessors.Add(newProcessor); }
public void SetParent(DataDescriber node, bool updateChildNodes = true) { if (node == Parent) { return; } // update the backing field ParentNode = node; // add this node to its new parent's children if (ParentNode != null && updateChildNodes) { ParentNode.Children.Add(this); } }
public DataDescriber(DataDescriber parent) { ParentNode = parent; Children = new List <DataDescriber>(); }