Beispiel #1
0
        public StringParser()
        {
            Type t = GetType();

            ParseMethods = t.GetMethods().Where(x => TypeAttribute.HasAttribute(x)).ToDictionary(
                (m) => TypeAttribute.GetAttribute(m).Type,
                (m) => new Func <string, object>((str) =>
                                                 Try.Func <object>(
                                                     () => m.Invoke(this, new object[] { str }),
                                                     (ex) => { throw ex.InnerException; }
                                                     )));
        }