Ejemplo n.º 1
0
        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);
                }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public DataDescriber(DataDescriber parent)
 {
     ParentNode = parent;
     Children   = new List <DataDescriber>();
 }