private static int AsfSettingsGetterFunc(int slot, ProviderPropertyDefinition propertyDefinition, IPropertyBag bag) { if (bag[propertyDefinition] == null) { bag[propertyDefinition] = HostedContentFilterPolicySchema.GetDefaultAsfOptionValues(); } int num = (slot % 2 == 0) ? 0 : 4; return((bag[propertyDefinition] as byte[])[slot / 2] >> num & 15); }
private static SetterDelegate AsfSettingsSetterDelegate(int slot, ProviderPropertyDefinition propertyDefinition) { return(delegate(object value, IPropertyBag bag) { if (bag[propertyDefinition] == null) { bag[propertyDefinition] = HostedContentFilterPolicySchema.GetDefaultAsfOptionValues(); } byte[] array = bag[propertyDefinition] as byte[]; int num = (slot % 2 == 0) ? 0 : 4; int num2 = (num == 0) ? 240 : 15; int num3 = (int)array[slot / 2]; num3 &= num2; num3 |= (int)value << num; array[slot / 2] = (byte)num3; (bag as PropertyBag).MarkAsChanged(propertyDefinition); }); }