コード例 #1
0
ファイル: HierarchyBuilder.cs プロジェクト: lazda/collabode
        public static IPropertyBagHierarchy GetHierarchy(SPWeb web)
        {
            IPropertyBagHierarchy hierarchyStack = null;

            if (SharePointEnvironment.InSandbox)
            {
                if (web == null && SharePointEnvironment.CanAccessFarmConfig)
                {
                    return new SandboxFarmPropertyBagHierarchy();
                }

                Validation.ArgumentNotNull(web, "web");

                if (SharePointEnvironment.CanAccessFarmConfig)
                {
                    hierarchyStack = new SandboxWithProxyPropertyBagHierarchy(web);
                }
                else
                {
                    hierarchyStack = new SandboxPropertyBagHierarchy(web);
                }
            }
            else
            {
                if (web != null)
                {
                    hierarchyStack = new FullTrustPropertyBagHierarchy(web);
                }
                else
                {
                    hierarchyStack = GetFarmHierarchy();
                }
            }
            return hierarchyStack;
        }
コード例 #2
0
        public static IPropertyBagHierarchy GetHierarchy(SPWeb web)
        {
            IPropertyBagHierarchy hierarchyStack = null;

            if (SharePointEnvironment.InSandbox)
            {
                if (web == null && SharePointEnvironment.CanAccessFarmConfig)
                {
                    return(new SandboxFarmPropertyBagHierarchy());
                }

                Validation.ArgumentNotNull(web, "web");

                if (SharePointEnvironment.CanAccessFarmConfig)
                {
                    hierarchyStack = new SandboxWithProxyPropertyBagHierarchy(web);
                }
                else
                {
                    hierarchyStack = new SandboxPropertyBagHierarchy(web);
                }
            }
            else
            {
                if (web != null)
                {
                    hierarchyStack = new FullTrustPropertyBagHierarchy(web);
                }
                else
                {
                    hierarchyStack = GetFarmHierarchy();
                }
            }
            return(hierarchyStack);
        }