示例#1
0
        public static Route Parse(String cleanUrl)
        {
            Dictionary <String, String> map = getMap();

            if (map.Count == 0)
            {
                return(null);
            }

            cleanUrl = cleanUrl.Trim().TrimStart(separator[0]);

            String[]  arrPathRow = cleanUrl.Split(RouteTool.Separator);
            OwnerInfo owner      = MemberPath.getOwnerInfo(arrPathRow);

            if (owner == null)
            {
                return(processController(parseRoute(cleanUrl), cleanUrl));
            }
            else
            {
                String urlWithoutOwnerInfo = getUrlWithoutOwnerInfo(arrPathRow);
                Route  x = parseRoute(urlWithoutOwnerInfo);
                if (x == null)
                {
                    return(null);
                }

                x.setOwner(owner.Owner);
                x.setOwnerType(owner.OwnerType);
                return(processController(x, cleanUrl));
            }
        }
示例#2
0
        //------------------------------------------------------------------------------------------------
        internal static OwnerInfo getOwnerInfo( String[] arrPathRow )
        {
            if (arrPathRow.Length < 2) return null;

            foreach (String key in _ownerTypeUrlMaps.Keys) {

                if (strUtil.EqualsIgnoreCase( arrPathRow[0], _ownerTypeUrlMaps[key] )) {

                    OwnerInfo ownerInfo = new OwnerInfo();
                    ownerInfo.Owner = arrPathRow[1];
                    ownerInfo.OwnerType = key;
                    return ownerInfo;
                }

            }

            return null;
        }
示例#3
0
        //------------------------------------------------------------------------------------------------

        internal static OwnerInfo getOwnerInfo(String[] arrPathRow)
        {
            if (arrPathRow.Length < 2)
            {
                return(null);
            }

            foreach (String key in _ownerTypeUrlMaps.Keys)
            {
                if (strUtil.EqualsIgnoreCase(arrPathRow[0], _ownerTypeUrlMaps[key]))
                {
                    OwnerInfo ownerInfo = new OwnerInfo();
                    ownerInfo.Owner     = arrPathRow[1];
                    ownerInfo.OwnerType = key;
                    return(ownerInfo);
                }
            }

            return(null);
        }