Example #1
0
        public VkMethodGenInfo GetMethodData(MethodInfo method)
        {
            var result = new VkMethodGenInfo {
                Name = method.Name
            };

            var apiNameAttr = method.GetCustomAttribute <ApiMethodNameAttribute>();

            if (apiNameAttr != null)
            {
                result.ApiMethod = apiNameAttr.Name;
                result.Order     = apiNameAttr.Order;
                result.Skip      = apiNameAttr.Skip;
            }

            var valuesAttrs = method.GetCustomAttributes <VkValueAttribute>();

            if (valuesAttrs != null)
            {
                foreach (var val in valuesAttrs)
                {
                    result.Params.Add(val.Name, val.Value.ToString());
                }
            }

            result.Params.Add("v", "5.9");
            return(result);
        }
Example #2
0
        public VkMethodGenInfo GetMethodData(MethodInfo method)
        {
            var result = new VkMethodGenInfo {Name = method.Name};

            var apiNameAttr = method.GetCustomAttribute<ApiMethodNameAttribute>();
            if (apiNameAttr != null)
            {
                result.ApiMethod = apiNameAttr.Name;
                result.Order = apiNameAttr.Order;
                result.Skip = apiNameAttr.Skip;
            }

            var valuesAttrs = method.GetCustomAttributes<VkValueAttribute>();
            if (valuesAttrs != null)
            {
                foreach (var val in valuesAttrs)
                {
                    result.Params.Add(val.Name, val.Value.ToString());
                }
            }

            result.Params.Add("v", "5.9");
            return result;
        }