Class Vibrator

    Definition

    Namespace:
    Tizen.System
    Assembly:
    Tizen.System.dll

    The Vibrator class provides the properties and methods to control a vibrator.

    public class Vibrator : IDisposable
    Inheritance
    object
    Vibrator
    Implements
    System.IDisposable
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Examples
        Console.WriteLine("Total number of Vibrators are: {0}", Tizen.System.Vibrator.NumberOfVibrators);

    Properties

    View Source

    NumberOfVibrators

    Gets the number of the available vibrators.

    Declaration
    public static int NumberOfVibrators { get; }
    Property Value
    Type Description
    int
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    View Source

    Vibrators

    Gets all the available vibrators.

    Declaration
    public static IReadOnlyList<Vibrator> Vibrators { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<T><Vibrator>
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    Methods

    View Source

    Dispose()

    Dispose API for closing the internal resources. This function can be used to stop all the effects started by Vibrate().

    Declaration
    public void Dispose()
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    View Source

    Dispose(bool)

    Dispose API for closing the internal resources. This function can be used to stop all the effects started by Vibrate().

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    View Source

    ~Vibrator()

    Finalizes an instance of the Vibrator class.

    Declaration
    protected ~Vibrator()
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    View Source

    Stop()

    Stops all the vibration effects which are being played. This function can be used to stop all the effects started by Vibrate().

    Declaration
    public void Stop()
    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Examples
        Vibrator vibrator = Vibrator.Vibrators[0];
        try
        {
            vibrator.Stop();
        }
        catch(Exception e)
        {
        }
    Exceptions
    Type Condition
    System.ArgumentException

    In case an invalid vibrator instance is used.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    System.NotSupportedException

    In case the device does not support this behavior.

    View Source

    Vibrate(int, int)

    Vibrates during the specified time with a constant intensity. This function can be used to start monotonous vibration for the specified time.

    Declaration
    public void Vibrate(int duration, int feedback)
    Parameters
    Type Name Description
    int duration

    The play duration in milliseconds.

    int feedback

    The amount of the intensity variation (0 ~ 100).

    Remarks

    The Vibrator API provides the way to access the vibrators in the device. It allows the management of the device's vibrator parameters, such as the vibration count and level. It provides the methods to vibrate and stop the vibration.

    Examples
        Vibrator vibrator = Vibrator.Vibrators[0];
        try
        {
            vibrator.Vibrate(2000, 70);
        }
        catch(Exception e)
        {
        }
    Exceptions
    Type Condition
    System.ArgumentException

    When an invalid parameter value is set.

    System.UnauthorizedAccessException

    If the privilege is not set.

    System.InvalidOperationException

    In case of any system error.

    System.NotSupportedException

    In case the device does not support this behavior.

    Implements

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