ref_default_for_extension_name


Description:

public Source? ref_default_for_extension_name (string extension_name)

This is a convenience function to return a default Source based on extension_name.

This only works with a subset of extension names.

If extension_name is SOURCE_EXTENSION_ADDRESS_BOOK, the function returns the current default address book, or else falls back to the built-in address book.

If extension_name is SOURCE_EXTENSION_CALENDAR , the function returns the current default calendar, or else falls back to the built-in calendar.

If extension_name is SOURCE_EXTENSION_MAIL_ACCOUNT, the function returns the current default mail account, or else falls back to the built-in mail account.

If extension_name is SOURCE_EXTENSION_MAIL_IDENTITY, the function returns the current default mail identity, or else falls back to the mail identity named by the current default mail account.

If extension_name is SOURCE_EXTENSION_MEMO_LIST , the function returns the current default memo list, or else falls back to the built-in memo list.

If extension_name is SOURCE_EXTENSION_TASK_LIST , the function returns the current default task list, or else falls back to the built-in task list.

For all other values of extension_name, the function returns null.

The returned Source is referenced for thread-safety and must be unreferenced with unref when finished with it.

Parameters:

this

an SourceRegistry

extension_name

an extension_name

Returns:

the default Source based on extension_name