コード例 #1
0
        public static void AddRulesToScopeAndCompile(string SiteCollection, string ScopeName, string FileShare)
        {
            Scopes SCScopes = GetScopesForSiteCollection(SiteCollection);

            Scope fsc = SCScopes.GetSharedScope(ScopeName);

            foreach (ScopeRule r in fsc.Rules)
            {
                Debug.WriteLine("Ruletype: " + r.RuleType);
            }

            fsc.Rules.CreateUrlRule(ScopeRuleFilterBehavior.Include, UrlScopeRuleType.Folder, FileShare);

            SCScopes.StartCompilation();
        }