Ejemplo n.º 1
0
 /// <summary>
 /// 获取代理者
 /// </summary>
 /// <param name="realObject">真实对象</param>
 /// <returns>代理者</returns>
 public object GetProxyer(IAspectTrackObject realObject)
 {
     if (_proxys.ContainsKey(realObject))
     {
         return(_proxys[realObject]);
     }
     else
     {
         GlobalTools.LogWarning("获取代理者失败:真实对象 " + realObject.ToString() + " 并不存在代理者!");
         return(null);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取代理对象
 /// </summary>
 /// <typeparam name="T">代理对象类型</typeparam>
 /// <param name="realObject">真实对象</param>
 /// <returns>代理对象</returns>
 public T GetProxyObject <T>(IAspectTrackObject realObject) where T : class, IAspectTrackObject
 {
     if (_proxyObjects.ContainsKey(realObject))
     {
         return(_proxyObjects[realObject] as T);
     }
     else
     {
         GlobalTools.LogWarning("获取代理对象失败:真实对象 " + realObject.ToString() + " 并不存在代理对象!");
         return(null);
     }
 }