Esempio n. 1
0
        }                                                                                          //__SILP__

        //__SILP__
        public T GetAspect <T>(string aspectPath, bool isDebug = false) where T : class, IAspect   //__SILP__
        {
            string[] keys = aspectPath.Split(PathConsts.PathSeparator);                            //__SILP__
            if (keys.Length < 1)                                                                   //__SILP__
            {
                ErrorOrDebug(isDebug, "Invalid aspectPath: {0}", aspectPath);                      //__SILP__
                return(null);                                                                      //__SILP__
            }                                                                                      //__SILP__
            IAspect topAspect;                                                                     //__SILP__

            if (!_TopAspectsDict.TryGetValue(keys[0], out topAspect))                              //__SILP__
            {
                ErrorOrDebug(isDebug, "Not Found: {0}", aspectPath);                               //__SILP__
                return(null);                                                                      //__SILP__
            }                                                                                      //__SILP__
            if (keys.Length == 1)                                                                  //__SILP__
            {
                return(As <T>(topAspect, isDebug));                                                //__SILP__
            }
            else                                                                                   //__SILP__
            {
                IOwner asOwner = As <IOwner>(topAspect, isDebug);                                  //__SILP__
                if (asOwner != null)                                                               //__SILP__
                {
                    return(TreeHelper.GetDescendant <T>(asOwner, keys, 1, isDebug));               //__SILP__
                }                                                                                  //__SILP__
            }                                                                                      //__SILP__
            return(null);                                                                          //__SILP__
        }                                                                                          //__SILP__
 public static T GetProperty <T>(this ITableProperties properties,
                                 string propertyPath, bool isDebug = false)
     where T : class, IProperty
 {
     return(TreeHelper.GetDescendant <T>(properties, propertyPath, isDebug));
 }
Esempio n. 3
0
 public static T GetContext <T>(this IDictContext context, string relPath,
                                bool isDebug = false)
     where T : class, IContext
 {
     return(TreeHelper.GetDescendant <T>(context, relPath, isDebug));
 }