public Among(System.String s, int substring_i, int result, System.String methodname, SnowballProgram methodobject) { this.s_size = s.Length; this.s = s; this.substring_i = substring_i; this.result = result; if (methodname.Length == 0) { this.method = null; } else { var m = methodobject.GetType().GetTypeInfo().GetDeclaredMethod(methodname); if (m == null) throw new Exception(); method = Expression.Lambda<Func<bool>>(Expression.Call(Expression.Constant(methodobject), m)).Compile(); } }
public Among(System.String s, int substring_i, int result, System.String methodname, SnowballProgram methodobject) { this.s_size = s.Length; this.s = s; this.substring_i = substring_i; this.result = result; if (methodname.Length == 0) { this.method = null; } else { var m = methodobject.GetType().GetTypeInfo().GetDeclaredMethod(methodname); if (m == null) { throw new Exception(); } method = Expression.Lambda <Func <bool> >(Expression.Call(Expression.Constant(methodobject), m)).Compile(); } }
public Among(System.String s, int substring_i, int result, System.String methodname, SnowballProgram methodobject) { this.s_size = s.Length; this.s = s; this.substring_i = substring_i; this.result = result; this.methodobject = methodobject; if (methodname.Length == 0) { this.method = null; } else { try { this.method = methodobject.GetType().GetMethod(methodname, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.DeclaredOnly, null, new System.Type[0], null); } catch (System.MethodAccessException e) { // FIXME - debug message this.method = null; } } }
public Among(System.String s, int substring_i, int result, System.String methodname, SnowballProgram methodobject) { this.s_size = s.Length; this.s = s; this.substring_i = substring_i; this.result = result; this.methodobject = methodobject; if (methodname.Length == 0) { this.method = null; } else { try { this.method = methodobject.GetType().GetMethod(methodname, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.DeclaredOnly, null, new System.Type[0], null); } catch (System.MethodAccessException e) { // FIXME - debug message this.method = null; } } }