public override void FromXml(SecurityElement e) { // General validation in CodeAccessPermission PermissionHelper.CheckSecurityElement(e, "e", version, version); // Note: we do not (yet) care about the return value // as we only accept version 1 (min/max values) _flags = (DataProtectionPermissionFlags)Enum.Parse( typeof(DataProtectionPermissionFlags), e.Attribute("Flags")); }
public override void FromXml(SecurityElement e) { // General validation in CodeAccessPermission PermissionHelper.CheckSecurityElement(e, "e", version, version); // Note: we do not (yet) care about the return value // as we only accept version 1 (min/max values) string s = e.Attribute("Flags"); if (s == null) { _flags = StorePermissionFlags.NoFlags; } else { _flags = (StorePermissionFlags)Enum.Parse(typeof(StorePermissionFlags), s); } }