Exemplo n.º 1
0
 public void PrintCode(CodeWriter cp)
 {
     cp.BeginLine();
     foreach (CodeCustomAttribute a in customAttributes)
     {
         a.PrintCode(cp);
     }
     cp.BeginLine();
     if (IsStatic)
     {
         cp.Write("static ");
     }
     if (IsPublic)
     {
         cp.Write("public ");
     }
     if (returnType != null)
     {
         cp.Write(returnType + " ");
     }
     cp.Write(name);
     if (parameterTypes.Length > 0)
     {
         cp.Write(name + " [");
         for (int n = 0; n < parameterTypes.Length; n++)
         {
             if (n > 0)
             {
                 cp.Write(", ");
             }
             cp.Write(parameterTypes[n] + " arg" + n);
         }
         cp.Write("]");
     }
     cp.Write(" {");
     cp.EndLine();
     cp.Indent();
     cp.WriteLineInd("get {");
     get_builder.PrintCode(cp);
     cp.WriteLineUnind("}");
     cp.WriteLine("set {");
     set_builder.PrintCode(cp);
     cp.WriteLine("}");
     cp.WriteLineUnind("}");
 }
Exemplo n.º 2
0
        public override void PrintCode(CodeWriter cp)
        {
            if (trueBlock == null)
            {
                return;
            }

            cp.Write("if (");
            condition.PrintCode(cp);
            cp.Write(") {");
            cp.EndLine();
            cp.Indent();
            trueBlock.PrintCode(cp);
            cp.Unindent();
            cp.BeginLine().Write("}");
            if (falseBlock != null)
            {
                cp.EndLine();
                cp.WriteLineInd("else {");
                falseBlock.PrintCode(cp);
                cp.Unindent();
                cp.BeginLine().Write("}");
            }
        }
Exemplo n.º 3
0
        public virtual void PrintCode(CodeWriter cp)
        {
            cp.BeginLine();
            foreach (CodeCustomAttribute a in customAttributes)
            {
                a.PrintCode(cp);
            }
            if ((methodBase.Attributes & MethodAttributes.Static) != 0)
            {
                cp.Write("static ");
            }
            if ((methodBase.Attributes & MethodAttributes.Public) != 0)
            {
                cp.Write("public ");
            }
            if (returnType != null)
            {
                cp.Write(returnType + " ");
            }
            cp.Write(name + " (");
            for (int n = 0; n < parameterTypes.Length; n++)
            {
                if (n > 0)
                {
                    cp.Write(", ");
                }
                cp.Write(parameterTypes[n] + " arg" + n);
            }
            cp.Write(")");
            cp.EndLine();
            cp.WriteLineInd("{");

            builder.PrintCode(cp);

            cp.WriteLineUnind("}");
        }
Exemplo n.º 4
0
		public virtual void PrintCode (CodeWriter cp)
		{
			cp.BeginLine ();
			foreach (CodeCustomAttribute a in customAttributes)
				a.PrintCode (cp);
			if ((methodBase.Attributes & MethodAttributes.Static) != 0)
				cp.Write ("static ");
			if ((methodBase.Attributes & MethodAttributes.Public) != 0)
				cp.Write ("public ");
			if (returnType != null) cp.Write (returnType + " ");
			cp.Write (name + " (");
			for (int n=0; n<parameterTypes.Length; n++) {
				if (n > 0) cp.Write (", ");
				cp.Write (parameterTypes[n] + " arg" + n);
			}
			cp.Write (")");
			cp.EndLine ();
			cp.WriteLineInd ("{");
			
			builder.PrintCode (cp);
			
			cp.WriteLineUnind ("}");
		}
		public void PrintCode (CodeWriter cp)
		{
			cp.BeginLine ();
			foreach (CodeCustomAttribute a in customAttributes)
				a.PrintCode (cp);
			cp.BeginLine ();
			if (IsStatic)
				cp.Write ("static ");
			if (IsPublic)
				cp.Write ("public ");
			if (returnType != null) cp.Write (returnType + " ");
			cp.Write (name);
			if (parameterTypes.Length > 0) {
				cp.Write (name + " [");
				for (int n=0; n<parameterTypes.Length; n++) {
					if (n > 0) cp.Write (", ");
					cp.Write (parameterTypes[n] + " arg" + n);
				}
				cp.Write ("]");
			}
			cp.Write (" {");
			cp.EndLine ();
			cp.Indent ();
			cp.WriteLineInd ("get {");
			get_builder.PrintCode (cp);
			cp.WriteLineUnind ("}");
			cp.WriteLine ("set {");
			set_builder.PrintCode (cp);
			cp.WriteLine ("}");
			cp.WriteLineUnind ("}");
		}
Exemplo n.º 6
0
		public override void PrintCode (CodeWriter cp)
		{
			if (trueBlock == null) return;
			
			cp.Write ("if (");
			condition.PrintCode (cp);
			cp.Write (") {");
			cp.EndLine ();
			cp.Indent ();
			trueBlock.PrintCode (cp);
			cp.Unindent ();
			cp.BeginLine ().Write ("}");
			if (falseBlock != null) {
				cp.EndLine ();
				cp.WriteLineInd ("else {");
				falseBlock.PrintCode (cp);
				cp.Unindent ();
				cp.BeginLine ().Write ("}");
			}
		}