private static IEnumerable<string> GetAvailablePathsByTypeAndPath(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;
            if (assocName.Length > 0)
                assocName = String.Concat("/", assocName);

            string[] parts = contextNodePath.Split('/');

            var probs = new List<string>();

            while (nodeType != null)
            {
                probs.Add(String.Concat("/{0}/", nodeType.Name, assocName));
                nodeType = nodeType.Parent;
            }

            var paths = new List<string>();

            paths.Add(String.Concat(contextNodePath, "/", appFolderName, "/This", assocName));

            var position = parts.Length + 1;
            string partpath;
            while (position-- > 2)
            {
                partpath = string.Join("/", parts, 0, position);
                foreach (var prob in probs)
                    paths.Add(String.Concat(partpath, string.Format(prob, appFolderName)));
            }
            return paths;
        }
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option, bool useCache)
 {
     AppFolderName = appFolderName;
     ResolveAll = resolveAll;
     ResolveChildren = resolveChildren;
     Option = option;
     UseCache = useCache;
     if (useCache)
         AppCacheInvalidator.Invalidate += new EventHandler<AppCacheInvalidateEventArgs>(AppCacheInvalidator_Invalidate);
 }
Exemple #3
0
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option, bool useCache)
 {
     AppFolderName   = appFolderName;
     ResolveAll      = resolveAll;
     ResolveChildren = resolveChildren;
     Option          = option;
     UseCache        = useCache;
     if (useCache)
     {
         AppCacheInvalidator.Invalidate += new EventHandler <AppCacheInvalidateEventArgs>(AppCacheInvalidator_Invalidate);
     }
 }
 internal static IEnumerable<string> GetAvailablePaths(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption hierarchyOption)
 {
     switch (hierarchyOption)
     {
         case HierarchyOption.Type:
             return GetAvailablePathsByType(contextNodePath, nodeType, appFolderName, appName, hierarchyOption);
         case HierarchyOption.Path:
             return GetAvailablePathsByPath(contextNodePath, nodeType, appFolderName, appName, hierarchyOption);
         case HierarchyOption.TypeAndPath:
             return GetAvailablePathsByTypeAndPath(contextNodePath, nodeType, appFolderName, appName, hierarchyOption);
         case HierarchyOption.PathAndType:
             return GetAvailablePathsByPathAndType(contextNodePath, nodeType, appFolderName, appName, hierarchyOption);
         default:
             throw new NotImplementedException(hierarchyOption.ToString());
     }
 }
        private static IEnumerable<string> GetAvailablePathsByType(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;
            if (assocName.Length > 0)
                assocName = String.Concat("/", assocName);

            var pathBase = String.Concat(contextNodePath, "/", appFolderName);
            var paths = new List<string>();

            paths.Add(String.Concat(pathBase, "/This", assocName));

            while (nodeType != null)
            {
                paths.Add(String.Concat(pathBase, "/", nodeType.Name, assocName));
                nodeType = nodeType.Parent;
            }

            return paths;
        }
        private static IEnumerable<string> GetAvailablePathsByPath(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;
            if (assocName.Length > 0)
                assocName = String.Concat("/", assocName);

            string[] parts = contextNodePath.Split('/');

            var paths = new List<string>();

            paths.Add(String.Concat(contextNodePath, "/", appFolderName, "/This", assocName));

            var position = parts.Length + 1;
            string partpath;
            while (position-- > 2)
            {
                partpath = string.Join("/", parts, 0, position);
                paths.Add(String.Concat(partpath, "/", appFolderName, assocName));
            }
            return paths;
        }
Exemple #7
0
        private static IEnumerable <string> GetAvailablePathsByTypeAndPath(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;

            if (assocName.Length > 0)
            {
                assocName = String.Concat("/", assocName);
            }

            string[] parts = contextNodePath.Split('/');

            var probs = new List <string>();

            while (nodeType != null)
            {
                probs.Add(String.Concat("/{0}/", nodeType.Name, assocName));
                nodeType = nodeType.Parent;
            }

            var paths = new List <string>();

            paths.Add(String.Concat(contextNodePath, "/", appFolderName, "/This", assocName));

            var    position = parts.Length + 1;
            string partpath;

            while (position-- > 2)
            {
                partpath = string.Join("/", parts, 0, position);
                foreach (var prob in probs)
                {
                    paths.Add(String.Concat(partpath, string.Format(prob, appFolderName)));
                }
            }
            return(paths);
        }
Exemple #8
0
        private static IEnumerable <string> GetAvailablePathsByPath(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;

            if (assocName.Length > 0)
            {
                assocName = String.Concat("/", assocName);
            }

            string[] parts = contextNodePath.Split('/');

            var paths = new List <string>();

            paths.Add(String.Concat(contextNodePath, "/", appFolderName, "/This", assocName));

            var    position = parts.Length + 1;
            string partpath;

            while (position-- > 2)
            {
                partpath = string.Join("/", parts, 0, position);
                paths.Add(String.Concat(partpath, "/", appFolderName, assocName));
            }
            return(paths);
        }
Exemple #9
0
        private static IEnumerable <string> GetAvailablePathsByType(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption option)
        {
            contextNodePath = contextNodePath.TrimEnd('/');

            var assocName = appName ?? String.Empty;

            if (assocName.Length > 0)
            {
                assocName = String.Concat("/", assocName);
            }

            var pathBase = String.Concat(contextNodePath, "/", appFolderName);
            var paths    = new List <string>();

            paths.Add(String.Concat(pathBase, "/This", assocName));

            while (nodeType != null)
            {
                paths.Add(String.Concat(pathBase, "/", nodeType.Name, assocName));
                nodeType = nodeType.Parent;
            }

            return(paths);
        }
Exemple #10
0
        internal static IEnumerable <string> GetAvailablePaths(string contextNodePath, NodeType nodeType, string appFolderName, string appName, HierarchyOption hierarchyOption)
        {
            switch (hierarchyOption)
            {
            case HierarchyOption.Type:
                return(GetAvailablePathsByType(contextNodePath, nodeType, appFolderName, appName, hierarchyOption));

            case HierarchyOption.Path:
                return(GetAvailablePathsByPath(contextNodePath, nodeType, appFolderName, appName, hierarchyOption));

            case HierarchyOption.TypeAndPath:
                return(GetAvailablePathsByTypeAndPath(contextNodePath, nodeType, appFolderName, appName, hierarchyOption));

            case HierarchyOption.PathAndType:
                return(GetAvailablePathsByPathAndType(contextNodePath, nodeType, appFolderName, appName, hierarchyOption));

            default:
                throw new SnNotSupportedException(hierarchyOption.ToString());
            }
        }
Exemple #11
0
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option)
     : this(appFolderName, resolveAll, resolveChildren, option, false)
 {
 }
Exemple #12
0
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option)
     : this(appFolderName, resolveAll, resolveChildren, option, false)
 {
 }