Example #1
0
 public static object Unmarshal(ObjectHandle arg)
 {
     if (arg == null)
     {
         return(null);
     }
     else
     {
         DelegateAdapter delAd = arg as DelegateAdapter;
         if (delAd != null)
         {
             return(DelegateAdapter.CreateDelegate(delAd));
         }
         TaskAdapter taskAd = arg as TaskAdapter;
         if (taskAd != null)
         {
             return(TaskAdapter.CreateTask(taskAd));
         }
         DynamicAdapter dynAd = arg as DynamicAdapter;
         if (dynAd != null)
         {
             return(DynamicAdapter.CreateProxy(dynAd));
         }
         StaticAdapter statAd = arg as StaticAdapter;
         if (statAd != null)
         {
             return(StaticAdapter.CreateProxy(statAd));
         }
         UnsafeHandle uns = arg as UnsafeHandle;
         if (uns != null)
         {
             return(UnsafeHandle.GetObject(uns));
         }
         return(arg.Unwrap());
     }
 }
Example #2
0
 public static DynamicProxy CreateProxy(DynamicAdapter adapter)
 {
     return(new DynamicProxy(adapter));
 }
Example #3
0
 public DynamicProxy(DynamicAdapter adapter) : base(adapter)
 {
     Adapter = adapter;
 }