/// <summary> /// Provided to register methods from external assemblies as C1 functions /// </summary> /// <typeparam name="T">Type of a class, which contains the needed method</typeparam> /// <param name="methodName">Name of the method to be registered</param> /// <param name="userMethodFullName"> /// Set up custom method full name for displaying in C1. /// For example: TestNamespace.TestClassName.TestMethodName /// </param> /// <param name="description">Can be provided a custom description for the method</param> public static void RegisterMethod <T>(string methodName, string userMethodFullName = null, string description = null) where T : class { var type = typeof(T); string userNamespace, userMethodName; if (string.IsNullOrWhiteSpace(userMethodFullName)) { userMethodName = methodName; userNamespace = type.Namespace; } else { ParseFunctionName(userMethodFullName, out userNamespace, out userMethodName); } var function = CodeBasedFunction.Create(type, methodName, userNamespace, userMethodName, description); Functions.Add(function); CodeBasedFunctionProvider.Reload(); }
internal CodeBasedFunctionEntityToken(CodeBasedFunction function) { Id = $"{function.Namespace}.{function.Name}"; }