Esempio n. 1
0
 public static bool RemoveAuthorizationRule(object target, AuthorizationRule rule)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     return(AuthorizationRuleManager.GetRules(target).Remove(rule));
 }
Esempio n. 2
0
 public static void AddAuthorizationRule(object target, AuthorizationRule rule)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     AuthorizationRuleManager.GetRules(target).Add(rule);
 }
Esempio n. 3
0
 public static void SetRule(DependencyObject target, AuthorizationRule value)
 {
     target.SetValue(Authorization.RuleProperty, value);
 }
Esempio n. 4
0
 public static AuthorizationResult Authorize(object target, AuthorizationRule rule)
 {
     AuthorizationRuleManager.AddAuthorizationRule(target, rule);
     return(Authorization.Authorize(target));
 }