Example #1
0
        public T GetValue <T>(string name)
        {
            T val;
            IEnumerable <FileProcessingJournalEntryDataBase> elements = EntryData.Where(item => item.Name == name);

            if (elements.Count() == 0)
            {
                return(default(T));
            }
            FileProcessingJournalEntryDataBase baseData = elements.First();

            Type t = typeof(FileProcessingJournalEntryData <>).MakeGenericType(Type.GetType(baseData.type));

            val = (T)t.GetProperty("Value").GetValue(baseData, null);
            return(val);
        }
Example #2
0
        public object this[string Name]
        {
            get
            {
                IEnumerable <FileProcessingJournalEntryDataBase> elements = EntryData.Where(item => item.Name == Name);
                if (elements.Count() == 0)
                {
                    return(null);
                }
                FileProcessingJournalEntryDataBase baseData = elements.First();

                Type t = typeof(FileProcessingJournalEntryData <>).MakeGenericType(Type.GetType(baseData.type));
                var  v = t.GetProperty("Value").GetValue(baseData, null);
                return(v);
            }
        }