onEvent["SCRIPT_ADDON_MEM_REQUEST"] = function(params)
  if params.target ~= common.GetAddonName() then return end
  userMods.SendEvent("SCRIPT_ADDON_MEM_RESPONSE", 
    { sender = params.target, memUsage = gcinfo() } )
end

onEvent["SCRIPT_ADDON_INFO_REQUEST"] = function(params)
  if params.target ~= common.GetAddonName() then return end
  local description = "PowerAuras r29 [18.11.2012] by Tycere"
  userMods.SendEvent("SCRIPT_ADDON_INFO_RESPONSE", 
  {
    sender = params.target,
    showSettingsButton = true,
    showHideButton = true,
    desc = (L and L["AddonDescription"]) or description
  })
end

onEvent["SCRIPT_TOGGLE_UI"] = function(params)
  mainForm:Show(params.visible)
end
onEvent["SCRIPT_SHOW_SETTINGS"] = function(params)
  if params.target == common.GetAddonName() and View.ShowSettings then View.ShowSettings() end
end
onEvent["SCRIPT_TOGGLE_VISIBILITY"] = function(params)
  if params.target == common.GetAddonName() and View.ToggleVisibility then View.ToggleVisibility() end
end
