public static MethodInfo[] GetVueMethods(Type compType, WebExposeType expose) { MethodInfo[] methods = compType.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly); switch (expose) { case WebExposeType.Attributed: methods = methods.Where(x => x.GetCustomAttribute <WebExposeAttribute>() != null).ToArray(); break; case WebExposeType.None: return(null); } return(methods); }
private void MapIPC(WebExposeType expose) { _ipcAvailable = new Dictionary <string, Func <JToken[], object> >(); MethodInfo[] methods = GetVueMethods(GetType(), expose); foreach (MethodInfo meth in methods) { if (_ipcAvailable.ContainsKey(meth.Name)) { throw new InvalidOperationException("Not allowed duplicate method names in UI class"); } ParameterInfo[] methParas = meth.GetParameters(); _ipcAvailable.Add(meth.Name, (paras) => { return(meth.Invoke(this, ConvertIPCParameters(methParas, paras))); }); } }
public ExposeSecurityAttribute(WebExposeType type) { Type = type; }