/// <summary>
        /// Creates the lua code function.
        /// </summary>
        /// <param name="dte">The DTE.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="name">The name.</param>
        /// <param name="returnType">Type of the return.</param>
        /// <param name="access">The access.</param>
        /// <param name="kind">The kind.</param>
        /// <param name="function">The function.</param>
        /// <returns></returns>
        public static LuaCodeFunction CreateLuaCodeFunction(
            DTE dte, CodeElement parent, string name, LuaType returnType, vsCMAccess access, vsCMFunction kind, FunctionDeclaration function)
        {
            var result = new LuaCodeFunction(dte, parent, name, kind,
                                             new LuaCodeTypeRef(dte, LuaDeclaredType.Find(returnType.ToString())),
                                             access, function);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a function to the Lua class.
        /// </summary>
        /// <param name="functionName"></param>
        /// <param name="kind"></param>
        /// <param name="returnType"></param>
        /// <param name="position"></param>
        /// <param name="functionAccess"></param>
        /// <param name="functionNode"></param>
        /// <returns></returns>
        public CodeFunction AddFunction(string functionName, vsCMFunction kind, object returnType, object position,
                                        vsCMAccess functionAccess, object functionNode)
        {
            var codeFunction = new LuaCodeFunction(
                DTE, this, functionName, kind, returnType, Access, functionNode as FunctionDeclaration);

            AddFunction(codeFunction);
            return(codeFunction);
        }
Beispiel #3
0
 /// <summary>
 /// Adds a function to the Lua class.
 /// </summary>
 /// <param name="function">LuaCodeFunction instance</param>
 public void AddFunction(LuaCodeFunction function)
 {
     childObjects.AddElement(function);
     CommitChanges();
 }