private void GenerateCodeFromMethod(CodeMemberMethod e, TextWriter w, CodeGeneratorOptions o)
        {
            if (e.UserData.Contains("DontGenerate"))
            {
                return;
            }

            var method = new MemberModel();

            method.Name     = e.Name;
            method.IsPublic = e.Attributes.HasFlag(MemberAttributes.Public);
            _currentType.Methods.Add(method);

            w.WriteLine("function " + e.Name);
            w.WriteLine("{");

            if (e.Parameters.Count > 0)
            {
                w.WriteLine("param(");
                for (int i = 0; i < e.Parameters.Count; i++)
                {
                    var parameter = e.Parameters[i];
                    w.Write("[{0}]${1}", parameter.Type.BaseType, parameter.Name);
                    if (i != e.Parameters.Count - 1)
                    {
                        w.Write(",");
                    }
                    w.WriteLine();
                }
                w.WriteLine(")");
            }


            foreach (CodeStatement statement in e.Statements)
            {
                GenerateCodeFromStatement(statement, w, o);
            }

            w.WriteLine("}");
        }
        private void GenerateCodeFromMethod(CodeMemberMethod e, TextWriter w, CodeGeneratorOptions o)
        {
            if (e.UserData.Contains("DontGenerate")) return;

            var method = new MemberModel();
            method.Name = e.Name;
            method.IsPublic = e.Attributes.HasFlag(MemberAttributes.Public);
            _currentType.Methods.Add(method);

            w.WriteLine("function " + e.Name);
            w.WriteLine("{");

            if (e.Parameters.Count > 0)
            {
                w.WriteLine("param(");
                for(int i = 0; i < e.Parameters.Count; i++)
                {
                    var parameter = e.Parameters[i];
                    w.Write("[{0}]${1}", parameter.Type.BaseType, parameter.Name);
                    if (i != e.Parameters.Count - 1)
                    {
                        w.Write(",");
                    }
                    w.WriteLine();
                }
                w.WriteLine(")");
            }

            foreach (CodeStatement statement in e.Statements)
            {
                GenerateCodeFromStatement(statement, w, o);
            }

            w.WriteLine("}");
        }
        private void GenerateCodeFromField(CodeMemberField e, TextWriter w, CodeGeneratorOptions o)
        {
            var member = new MemberModel();
            member.Name = e.Name;
            member.IsPublic = e.Attributes.HasFlag(MemberAttributes.Public);
            _currentType.Properties.Add(member);

            if (e.Type != null && e.Type.BaseType != "System.Void")
            {
                w.Write("[{0}]", e.Type.BaseType);
            }

            w.Write("$" + e.Name);

            if (e.InitExpression != null)
            {
                w.Write(" = ");
                GenerateCodeFromExpression(e.InitExpression, w, o);
                w.Write("\r\n");
            }
            else
            {
                w.Write(" = $null\r\n");
            }
        }