dbus/mono ProxyBuilder.cs,1.8,1.9

Joe Shaw joe at freedesktop.org
Sat Mar 12 21:07:37 PST 2005


Update of /cvs/dbus/dbus/mono
In directory gabe:/tmp/cvs-serv21945/mono

Modified Files:
	ProxyBuilder.cs 
Log Message:
2005-03-13  Joe Shaw  <joeshaw at novell.com>
 
	* mono/ProxyBuilder.cs (BuildConstructor): Decalre a local
	variable for storing our callback in.  Update the allocation
	comments.

Index: ProxyBuilder.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/ProxyBuilder.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ProxyBuilder.cs	13 Mar 2005 02:05:56 -0000	1.8
+++ ProxyBuilder.cs	13 Mar 2005 05:07:35 -0000	1.9
@@ -412,6 +412,10 @@
 							       CallingConventions.Standard, pars);
 
       ILGenerator generator = constructor.GetILGenerator();
+
+      LocalBuilder handlerL = generator.DeclareLocal (typeof (Service.SignalCalledHandler));
+      handlerL.SetLocalSymInfo ("handler");
+
       generator.Emit(OpCodes.Ldarg_0);
       generator.Emit(OpCodes.Call, this.introspector.Constructor);
       //generator.EmitWriteLine("service = myService");
@@ -422,17 +426,19 @@
       generator.Emit(OpCodes.Ldarg_2);
       generator.Emit(OpCodes.Stfld, pathF);
 
-      //generator.EmitWriteLine("this.delegate_created = new Service.SignalCalledHandler(Service_SignalCalled)");      
+      //generator.EmitWriteLine("handler = new Service.SignalCalledHandler(Service_SignalCalled)");      
       generator.Emit(OpCodes.Ldarg_1);
       generator.Emit(OpCodes.Ldarg_0);
       generator.Emit(OpCodes.Ldftn, signalCalledMI);
       generator.Emit(OpCodes.Newobj, Service_SignalCalledHandlerC);
       generator.Emit(OpCodes.Stloc_0);
+
+      //generator.EmitWriteLine("this.delegate_created = handler");
       generator.Emit(OpCodes.Ldarg_0);
       generator.Emit(OpCodes.Ldloc_0);
       generator.Emit(OpCodes.Stfld, deleF);
 
-      //generator.EmitWriteLine("myService.SignalCalled += this.delegate_created");
+      //generator.EmitWriteLine("myService.SignalCalled += handler");
       generator.Emit(OpCodes.Ldloc_0);
       generator.EmitCall(OpCodes.Callvirt, Service_AddSignalCalledMI, null);
 
@@ -469,7 +475,7 @@
        // because that is always going to be a nop, lets just ignore that here.
        // If you are trying to find the right code, look at what mcs does ;-).
 
-       MethodBuilder mb = tb.DefineMethod("Finalize", 
+       MethodBuilder mb = tb.DefineMethod("Finalize",
 					  MethodAttributes.Family |
 					  MethodAttributes.HideBySig |
 					  MethodAttributes.Virtual, 
@@ -571,7 +577,7 @@
 	// monodis. Note that in order for this to work you should copy
 	// the client assembly as a dll file so that monodis can pick it
 	// up.
-	//Service.ProxyAssembly.Save("proxy.dll");
+	//Service.ProxyAssembly.Save(Service.Name + ".proxy.dll");
       }
 
       Type [] parTypes = new Type[] {typeof(Service), typeof(string)};



More information about the dbus-commit mailing list