internal static void RegisterCustomRestriction(string resourceType, int propId, IResourceRestriction restriction) { if (resourceType == null) { throw new ArgumentNullException("resourceType"); } if (!MyPalStorage.Storage.ResourceTypes.Exist(resourceType)) { throw new ArgumentException("Invalid resource type " + resourceType, resourceType); } string restrictionClass = restriction.GetType().FullName; CustomRestriction existingRestriction = (CustomRestriction)_customRestrictions [restrictionClass]; if (existingRestriction != null) { existingRestriction.SetImplementation(restriction); } else { CustomRestriction customRestriction = new CustomRestriction(resourceType, propId, restriction); AddResourceRestriction(customRestriction); customRestriction.SaveToResourceStore(); _customRestrictions [restrictionClass] = customRestriction; } }
internal static void RegisterRestrictionOnDelete(string resourceType, IResourceRestriction restriction) { RegisterCustomRestriction(resourceType, ResourceProps.Id, restriction); }
internal void SetImplementation(IResourceRestriction restriction) { _restriction = restriction; }
public CustomRestriction(string resourceType, int propId, IResourceRestriction restriction) : base(resourceType, propId) { _restriction = restriction; _restrictionClass = _restriction.GetType().FullName; }
public void RegisterRestrictionOnDelete(string resourceType, IResourceRestriction restriction) { throw new NotImplementedException(); }
public void RegisterCustomRestriction(string resourceType, int propId, IResourceRestriction restriction) { throw new NotImplementedException(); }