home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / Remoting / RemTools / RemSpy.cs < prev   
Encoding:
Text File  |  2000-06-23  |  2.9 KB  |  130 lines

  1. using System;
  2. using System.Runtime.Remoting;
  3.  
  4. namespace RemSpy
  5. {
  6. /*
  7.    public ObjectSpied
  8.    {
  9.      String URI;
  10.      String TypeName;
  11.      int    callTotal;
  12.      int    callIn;
  13.      int    callOut;
  14.    }
  15.  
  16.    public class Manager()
  17.    {
  18.       public RemSpyDynamicProperty remSpyDynamicProperty = null;
  19.       public Manager()
  20.       {  
  21.       }
  22.  
  23.       //Install Probes
  24.          public InstallDynamicProperty()
  25.          {
  26.            //bool b = Context.RegisterDynamicProperty(IDynamicProperty prop, MarshalByRefObject obj, Context ctx);
  27.  
  28.        RemSpyDynamicProperty remSpyDynamicProperty = new RemSpyDynamicProperty();
  29.            bool b = Context.RegisterDynamicProperty(remSpyDynamicProperty, null, null);
  30.      }
  31.  
  32.       // Provide Data
  33.       public ObjectSpied[] AllObjects()
  34.       {
  35.       } 
  36.  
  37.       public ObjectSpied[] MarshaledObjects()
  38.       {
  39.       } 
  40.  
  41.       public ObjectSpied[] UnmarshaledObjects()
  42.       {
  43.       } 
  44.  
  45.       public ObjectSpied[] DisconnectedObjects()
  46.       {
  47.       } 
  48.  
  49.       //Statics Gathering
  50.       public static void UpdateStaticsFromIMessage(IMessage msg)
  51.       {
  52.       }
  53.  
  54.     // Notify a handler that an object has been marshaled
  55.     public static void MarshaledObject(Object obj, ObjRef or)
  56.     {
  57.     }
  58.     
  59.     // Notify a handler that an object has been unmarshaled
  60.     public static void UnmarshaledObject(Object obj, ObjRef or)
  61.     {
  62.     }
  63.     
  64.     // Notify a handler that an object has been disconnected
  65.     public static void DisconnectedObject(Object obj)
  66.     {
  67.     }
  68.  
  69.       
  70.    }  
  71.  
  72.   public RemSpyDynamicProperty : IDynamicProperty, IContributeDynamicSink
  73.   {
  74.         public RemSpyDynamicProperty()
  75.         {
  76.         }
  77.  
  78.         public RemSpyDynamicProperty(MarshalByRefObject obj, Context ctx)
  79.         {
  80.         }
  81.  
  82.         public String Name 
  83.         {
  84.           get 
  85.           {
  86.             return "RemSpy.RemSpyDynamicProperty";
  87.           }
  88.         } 
  89.  
  90.         public IDynamicMessageSink GetDynamicSink()
  91.         {
  92.           return new RemSpyDynamicMessageSink();
  93.         }
  94.  
  95.   }
  96.  
  97.   public RemSpyDynamicMessageSink : IDynamicMessageSink
  98.   {
  99.     public interface IDynamicMessageSink
  100.     {
  101.         void ProcessMessageStart(IMessage reqMsg, bool bCliSide, bool bAsync)
  102.         {
  103.           Manager.UpdateStaticsFromIMessage(reqMsg);
  104.         }
  105.         void ProcessMessageFinish(IMessage replyMsg, bool bCliSide, bool bAsync)
  106.         {
  107.           Manager.UpdateStaticsFromIMessage(replyMsg);
  108.         }
  109.     }
  110.   }
  111.  
  112.   public RemSpyTrackingHandler : ITrackingHandler
  113.   {
  114.     // Notify a handler that an object has been marshaled
  115.     void MarshaledObject(Object obj, ObjRef or)
  116.     {
  117.     }
  118.     
  119.     // Notify a handler that an object has been unmarshaled
  120.     void UnmarshaledObject(Object obj, ObjRef or)
  121.     {
  122.     }
  123.     
  124.     // Notify a handler that an object has been disconnected
  125.     void DisconnectedObject(Object obj)
  126.     {
  127.     }
  128.   }
  129. */
  130. }