Ejemplo n.º 1
0
 public void AddRestriction(RestrictionInfo info)
 {
     Debug.Assert(info != null);
     _userRestrictions.Add(info);
 }
Ejemplo n.º 2
0
        private void Restriction_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Restriction rest = sender as Restriction;
            Debug.Assert(rest != null);

            RestrictionInfo info = _settings.GetUserRestriction(
                rest.NetworkAttributeName);

            if (info != null)
            {
                // currently only Enabled property can be modified
                info.IsTurnedOn = rest.IsEnabled;
            }
            else
            {
                // add new restriction entry to config
                info = new RestrictionInfo();
                info.Name = rest.NetworkAttributeName;
                info.Description = rest.Description;
                info.IsEditable = rest.IsEditable;
                info.IsTurnedOn = rest.IsEnabled;
                _settings.AddRestriction(info);
            }
        }