Exemplo n.º 1
0
        public void GenerateDeclaration(StreamWriter sw, VirtualMethod complement)
        {
            VMSignature vmsig = new VMSignature(parms);

            if (IsGetter)
            {
                string name = Name.StartsWith("Get") ? Name.Substring(3) : Name;
                string type = retval.IsVoid ? parms [1].CSType : retval.CSType;
                if (complement != null && complement.parms [1].CSType == type)
                {
                    sw.WriteLine("\t\t" + type + " " + name + " { get; set; }");
                }
                else
                {
                    sw.WriteLine("\t\t" + type + " " + name + " { get; }");
                    if (complement != null)
                    {
                        sw.WriteLine("\t\t" + complement.retval.CSType + " " + complement.Name + " (" + (new VMSignature(complement.parms)) + ");");
                    }
                }
            }
            else if (IsSetter)
            {
                sw.WriteLine("\t\t" + parms[1].CSType + " " + Name.Substring(3) + " { set; }");
            }
            else
            {
                sw.WriteLine("\t\t" + retval.CSType + " " + Name + " (" + vmsig + ");");
            }
        }
        private void GenVMDeclaration(StreamWriter sw, ClassBase implementor)
        {
            VMSignature vmsig = new VMSignature(parms);

            sw.WriteLine("\t\t[GLib.DefaultSignalHandler(Type=typeof(" + (implementor != null ? implementor.QualifiedName : container_type.QualifiedName) + "), ConnectionMethod=\"Override" + Name + "\")]");
            sw.Write("\t\tprotected ");
            if (NeedNew(implementor))
            {
                sw.Write("new ");
            }
            sw.WriteLine("virtual {0} {1} ({2})", retval.CSType, "On" + Name, vmsig.ToString());
        }
Exemplo n.º 3
0
		public void GenerateDeclaration (StreamWriter sw, VirtualMethod complement)
		{
			VMSignature vmsig = new VMSignature (parms);
			if (IsGetter) {
				string name = Name.StartsWith ("Get") ? Name.Substring (3) : Name;
				string type = retval.IsVoid ? parms [1].CSType : retval.CSType;
				if (complement != null && complement.parms [1].CSType == type)
					sw.WriteLine ("\t\t" + type + " " + name + " { get; set; }");
				else {
					sw.WriteLine ("\t\t" + type + " " + name + " { get; }");
					if (complement != null)
						sw.WriteLine ("\t\t" + complement.retval.CSType + " " + complement.Name + " (" + (new VMSignature (complement.parms)) + ");");
				}
			} else if (IsSetter) 
				sw.WriteLine ("\t\t" + parms[1].CSType + " " + Name.Substring (3) + " { set; }");
			else
				sw.WriteLine ("\t\t" + retval.CSType + " " + Name + " (" + vmsig + ");");
		}
Exemplo n.º 4
0
		private void GenVMDeclaration (StreamWriter sw, ClassBase implementor)
		{
			VMSignature vmsig = new VMSignature (parms);
			sw.WriteLine ("\t\t[GLib.DefaultSignalHandler(Type=typeof(" + (implementor != null ? implementor.QualifiedName : container_type.QualifiedName) + "), ConnectionMethod=\"Override" + Name +"\")]");
			sw.Write ("\t\tprotected ");
			if (NeedNew (implementor))
				sw.Write ("new ");
			sw.WriteLine ("virtual {0} {1} ({2})", retval.CSType, "On" + Name, vmsig.ToString ());
		}