public void Register <T>(IDataProcessor <T> processor)
 {
     dataProcessors.Add(new DataProcessorInfo
     {
         DataProcessor     = processor,
         DataType          = typeof(T),
         ProcessMethodInfo = processor.GetType().GetMethod("ProcessData")
     });
 }
        void AddProcessor(IDataProcessor someProcessor)
        {
            Type typeToAdd = someProcessor.GetType();

            if (typeDictionary.ContainsKey(typeToAdd))
            {
                throw new ArgumentException(
                          String.Format(
                              "Cannot add same type of processor twice! Type: {0}"
                              , typeToAdd
                              )
                          );
            }
            someProcessor.OnAttach(this.dataCenter);

            typeDictionary.Add(typeToAdd, someProcessor);
            processorList.Add(someProcessor);
        }
        public static IEnumerable <DataProcessorPropertyInfo> GetPropertyInfos(this IDataProcessor self)
        {
            var allPropertyInfos         = self.GetType().GetProperties();
            var inputOutputPropertyInfos = new List <DataProcessorPropertyInfo>();

            foreach (var propertyInfo in allPropertyInfos)
            {
                var inputAttribute  = propertyInfo.GetCustomAttribute <InputAttribute>();
                var outputAttribute = propertyInfo.GetCustomAttribute <OutputAttribute>();

                if (inputAttribute != null)
                {
                    inputOutputPropertyInfos.Add(new DataProcessorPropertyInfo(propertyInfo, self, inputAttribute));
                }

                if (outputAttribute != null)
                {
                    inputOutputPropertyInfos.Add(new DataProcessorPropertyInfo(propertyInfo, self, outputAttribute));
                }
            }

            return(inputOutputPropertyInfos);
        }
Beispiel #4
0
 private static bool xdeb098800b3ee141(IDataProcessor x08db3aeabb253cb1)
 {
     return (x08db3aeabb253cb1.GetType().Name == typeof(LinearScale).Name);
 }
Beispiel #5
0
 private static bool x1e076d75160be815(IDataProcessor x08db3aeabb253cb1)
 {
     return (x08db3aeabb253cb1.GetType().Name == typeof(SimpleFunctionalPreprocessorLogic).Name);
 }
Beispiel #6
0
 private static bool xad1d75c4f41a1f7d(IDataProcessor x08db3aeabb253cb1)
 {
     return (x08db3aeabb253cb1.GetType().Name == typeof(SimpleFunctionalPreprocessorLogic).Name);
 }
Beispiel #7
0
 private static bool x716bafe7619d8264(IDataProcessor x08db3aeabb253cb1)
 {
     return (x08db3aeabb253cb1.GetType().Name == typeof(LinearScale).Name);
 }
 public DataProcessorInfo(IDataProcessor dataProcessor) : this(dataProcessor.GetType())
 {
     Instance = dataProcessor;
 }