Class Session

    Definition

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

    Provides methods to manage subsession users. Allows to register for events triggered by operations on subsession users.

    public sealed class Session
    Inheritance
    object
    Session

    Fields

    View Source

    CurrentUID

    UID of current system user.

    Declaration
    public static readonly int CurrentUID
    Field Value
    Type Description
    int
    View Source

    EmptyUser

    Special subsession ID, which is always present and does not represent any user.

    Declaration
    public const string EmptyUser
    Field Value
    Type Description
    string
    View Source

    MaxUserLength

    Maximum length of any given user ID.

    Declaration
    public const int MaxUserLength
    Field Value
    Type Description
    int

    Properties

    View Source

    SessionUID

    Gets session UID of this session object.

    Declaration
    public int SessionUID { get; }
    Property Value
    Type Description
    int

    Methods

    View Source

    GetCurrentUser()

    Gets a currently active subession user ID for this session.

    Declaration
    public string GetCurrentUser()
    Returns
    Type Description
    string
    Remarks

    When no subsession is enabled, "" (empty string, see EmptyUser field) is returned. This doesn't mean that "" is a subsession ID in the same way as others; it is just a marker meaning that no subsession is enabled.

    View Source

    GetInstance(int)

    Gets a Session object instance for a given sessionUID.

    Declaration
    public static Session GetInstance(int sessionUID)
    Parameters
    Type Name Description
    int sessionUID

    Session UID of a requested Session object instance

    Returns
    Type Description
    Session

    Returns requested Session object

    Remarks

    To ensure thread safety, explicit creation of Session object is not allowed.

    View Source

    GetUsers()

    Gets a list of all available subsession user IDs for this session.

    Declaration
    public IReadOnlyList<string> GetUsers()
    Returns
    Type Description
    IReadOnlyList<><string>
    Remarks

    The list of users depends on whether the session UID for this session object exists or not. If it doesn't, the user list is empty (in particular this is not an error). However if the session UID exists, the user list will contain the subsession IDs (if they exist), but also the default value, which is "" (empty string, see EmptyUser field). This doesn't mean that "" is a subsession ID in the same way as others; it is just a marker meaning that no subsession is enabled.

    View Source

    SubsessionAddUserAsync(string)

    Request new subsession to be created.

    Declaration
    public Task SubsessionAddUserAsync(string userName)
    Parameters
    Type Name Description
    string userName

    Subesssion user ID to be created

    Returns
    Type Description
    Task
    Remarks

    Subsession ID must not start with a dot or have slashes.

    View Source

    SubsessionEventMarkAsDone(SubsessionEventArgs)

    Mark event as completed.

    Declaration
    public void SubsessionEventMarkAsDone(SubsessionEventArgs subsessionEventArgs)
    Parameters
    Type Name Description
    SubsessionEventArgs subsessionEventArgs

    Event argument of the event (obtained from said event)

    Remarks

    This method is assumed to be called from an event handler. You can only mark an event as completed if you registered for in in the same process.

    View Source

    SubsessionRemoveUserAsync(string)

    Request an existing subsession to be removed.

    Declaration
    public Task SubsessionRemoveUserAsync(string userName)
    Parameters
    Type Name Description
    string userName

    Existing subesssion user ID to be removed

    Returns
    Type Description
    Task
    Remarks

    Subsession ID must not start with a dot or have slashes. Only inactive session ID can be removed. In order remove currently used session ID first switch to special session ID "" (empty string, see EmptyUser), and only after switch completes, remove previously active session ID.

    View Source

    SubsessionSwitchUserAsync(string)

    Request a subession to become currently active.

    Declaration
    public Task SubsessionSwitchUserAsync(string userName)
    Parameters
    Type Name Description
    string userName

    Existing subesssion user ID to be set as active

    Returns
    Type Description
    Task
    Remarks

    Subsession ID must not start with a dot or have slashes. Special subsession ID "" (empty string, see EmptyUser) can be switched to, when it's required to deactivate current subsession (this step is needed when current session is to be removed).

    Events

    View Source

    AddUserWait

    Event to be invoked when a new subession user is successfully added to this session.

    Declaration
    public event EventHandler<AddUserEventArgs> AddUserWait
    Event Type
    Type Description
    EventHandler<><AddUserEventArgs>
    View Source

    RemoveUserWait

    Event to be invoked when a subession user is successfully removed from this session.

    Declaration
    public event EventHandler<RemoveUserEventArgs> RemoveUserWait
    Event Type
    Type Description
    EventHandler<><RemoveUserEventArgs>
    View Source

    SwitchUserCompleted

    Event to be invoked when an existing subession user is successfully switched to an acvite state.

    Declaration
    public event EventHandler<SwitchUserCompletionEventArgs> SwitchUserCompleted
    Event Type
    Type Description
    EventHandler<><SwitchUserCompletionEventArgs>
    View Source

    SwitchUserWait

    Event to be invoked when an existing subession user has begun switching to an active state.

    Declaration
    public event EventHandler<SwitchUserWaitEventArgs> SwitchUserWait
    Event Type
    Type Description
    EventHandler<><SwitchUserWaitEventArgs>

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX