public OSPermissionState parseOSPermissionState(object stateDict) { var stateDictCasted = stateDict as Dictionary <string, object>; var state = new OSPermissionState(); state.hasPrompted = Convert.ToBoolean(stateDictCasted["hasPrompted"]); state.status = (OSNotificationPermission)Convert.ToInt32(stateDictCasted["status"]); return(state); }
public OSPermissionState ParseOSPermissionState(object stateDict) { var stateDictCasted = stateDict as Dictionary <string, object>; var state = new OSPermissionState(); state.hasPrompted = true; var toIsEnabled = Convert.ToBoolean(stateDictCasted["enabled"]); state.status = toIsEnabled ? OSNotificationPermission.Authorized : OSNotificationPermission.Denied; return(state); }