예제 #1
0
        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);
        }
예제 #2
0
        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)));
                });
            }
        }
예제 #3
0
 public ExposeSecurityAttribute(WebExposeType type)
 {
     Type = type;
 }