コード例 #1
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;
        }
コード例 #2
0
ファイル: ApplicationQuery.cs プロジェクト: maxpavlov/FlexNet
 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);
 }
コード例 #3
0
ファイル: ApplicationQuery.cs プロジェクト: y1027/sensenet
 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);
     }
 }
コード例 #4
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 NotImplementedException(hierarchyOption.ToString());
     }
 }
コード例 #5
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;
        }
コード例 #6
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;
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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());
            }
        }
コード例 #11
0
ファイル: ApplicationQuery.cs プロジェクト: maxpavlov/FlexNet
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option)
     : this(appFolderName, resolveAll, resolveChildren, option, false)
 {
 }
コード例 #12
0
ファイル: ApplicationQuery.cs プロジェクト: y1027/sensenet
 public ApplicationQuery(string appFolderName, bool resolveAll, bool resolveChildren, HierarchyOption option)
     : this(appFolderName, resolveAll, resolveChildren, option, false)
 {
 }