Class Notification

    Definition

    Namespace:
    Tizen.Applications.Notifications
    Assembly:
    Tizen.Applications.Notification.dll

    This class contains common properties and methods of notifications.

    public sealed class Notification : IDisposable
    Inheritance
    object
    Notification
    Implements
    System.IDisposable
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Constructors

    View Source

    Notification()

    Initializes a new instance of the Notification class.

    Declaration
    public Notification()
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Properties

    View Source

    Accessory

    Gets or sets Notification.AccessorySet which is included vibration, LED and sound option to be applied at notification.

    Declaration
    public Notification.AccessorySet Accessory { get; set; }
    Property Value
    Type Description
    Notification.AccessorySet
    Remarks

    If you set it to null, the already set AccessorySet will be initialized.

    Examples
    Notification notification = new Notification
    {
        Title = "Notification",
        Content = "Hello Tizen",
        Icon = "Icon path",
        Count = 3
    };
    
    Notification.AccessorySet accessory = new Notification.AccessorySet
    {
        SoundOption = AccessoryOption.Custom,
        SoundPath = "Sound File Path",
        CanVibrate = true,
        LedOption = AccessoryOption.Custom,
        LedOnMillisecond = 100,
        LedOffMillisecond = 50,
        LedColor = Tizen.Common.Color.Lime
    };
    
    notification.Accessory = accessory;
    
    NotificationManager.Post(notification);
    View Source

    Action

    Gets or sets action, which is invoked when the notification is clicked.

    Declaration
    public AppControl Action { get; set; }
    Property Value
    Type Description
    AppControl
    Remarks

    If you set it to null, the already set AppControl will be removed and nothing will happen when you click on notification.

    See Also
    AppControl
    View Source

    Content

    Gets or sets the content of notification.

    Declaration
    public string Content { get; set; }
    Property Value
    Type Description
    string
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    Count

    Gets or sets count, which is displayed at the right side of the notification.

    Declaration
    public int Count { get; set; }
    Property Value
    Type Description
    int
    Remarks

    You must set only positive number. If you set count to negative number, this property throws exception.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    Icon

    Gets or sets the icon of notification. You should set an absolute path for an image file.

    Declaration
    public string Icon { get; set; }
    Property Value
    Type Description
    string
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    IsTimeStampVisible

    Gets or sets a value indicating whether TimeStamp of the notification is Visible or not. Default to true.

    Declaration
    public bool IsTimeStampVisible { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    IsVisible

    Gets or sets a value indicating whether notification is displayed on the default viewer. If you set false and add style, you can see only style notification.

    Declaration
    public bool IsVisible { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    Progress

    Gets or sets Notification.ProgressType object for display at notification.

    Declaration
    public Notification.ProgressType Progress { get; set; }
    Property Value
    Type Description
    Notification.ProgressType
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    See Also
    Notification.ProgressType
    View Source

    Property

    Gets or sets property.

    Declaration
    public NotificationProperty Property { get; set; }
    Property Value
    Type Description
    NotificationProperty
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    See Also
    NotificationProperty
    View Source

    SubIcon

    Gets or sets the sub icon of notification. This SubIcon is displayed in Icon you set. You should set an absolute path for an image file.

    Declaration
    public string SubIcon { get; set; }
    Property Value
    Type Description
    string
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    Tag

    Gets or sets the tag of notification.

    Declaration
    public string Tag { get; set; }
    Property Value
    Type Description
    string
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    TimeStamp

    Gets or sets the TimeStamp of notification.

    Declaration
    public DateTime TimeStamp { get; set; }
    Property Value
    Type Description
    System.DateTime
    Remarks

    If you don't set TimeStamp, it will set the value when the notification is posted. TimeStamp requires NotificationManager.Post() to be called. If you set IsVisibleTimeStamp property to false, TimeStamp is not visible in notification.

    View Source

    Title

    Gets or sets the title of notification.

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    string
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Methods

    View Source

    AddStyle(StyleBase)

    Method for adding various styles to be applied to notification.

    Declaration
    public void AddStyle(Notification.StyleBase style)
    Parameters
    Type Name Description
    Notification.StyleBase style

    The style to be applied to notification.

    Remarks

    The user always see about valid notification style. If you add a style which is not supported in platform, this method has no effect.

    Examples
    Notification notification = new Notification
    {
        Title = "Notification",
        Content = "Hello Tizen",
        Icon = "Icon path",
        Count = 3
    };
    
    Notification.LockStyle lockStyle = new Notification.LockStyle
    {
        IconPath = "Icon path",
        ThumbnailPath = "Thumbnail Path"
    };
    
    notification.AddStyle(lockStyle);
    
    NotificationManager.Post(notification);
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    Dispose()

    Releases any unmanaged resources used by this object.

    Declaration
    public void Dispose()
    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    View Source

    GetExtraData(string)

    Method to get extra data you already set.

    Declaration
    public Bundle GetExtraData(string key)
    Parameters
    Type Name Description
    string key

    The key of the extra data to get.

    Returns
    Type Description
    Bundle

    Bundle Object that include extra data

    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    GetStyle<T>()

    Method to get style you already added.

    Declaration
    public T GetStyle<T>() where T : Notification.StyleBase, new()
    Returns
    Type Description
    T

    The Notification.Style object associated with the given style.

    Type Parameters
    Name Description
    T

    Type of notification style to be queried.

    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    RemoveExtraData(string)

    Method to remove extra you already added.

    Declaration
    public void RemoveExtraData(string key)
    Parameters
    Type Name Description
    string key

    The key of the extra data to add.

    Remarks

    The type of extra data is bundle.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    RemoveStyle<T>()

    Method to remove style you already added.

    Declaration
    public void RemoveStyle<T>() where T : Notification.StyleBase, new()
    Type Parameters
    Name Description
    T

    Type of notification style to be queried.

    Remarks

    A notification is a message that is displayed on the notification area. It is created to notify information to the user through the application. This class helps you to provide method and property for creating notification object.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    View Source

    SetExtraData(string, Bundle)

    Method to set extra data to add extra data.

    Declaration
    public void SetExtraData(string key, Bundle value)
    Parameters
    Type Name Description
    string key

    The key of the extra data you want to add.

    Bundle value

    The value you want to add.

    Remarks

    The type of extra data is bundle.

    Examples
    Notification notification = new Notification
    {
        Title = "Notification",
        Content = "Hello Tizen",
        Icon = "Icon path",
    };
    
    Bundle bundle = new Bundle();
    bundle.AddItem("key", "value");
    
    notification.SetExtraData("firstKey", bundle);
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when argument is invalid.

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX