Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new Cobrowse.io session.
 /// </summary>
 public void CreateSession(CobrowseCallback callback)
 {
     CobrowseIO.Instance.CreateSession((JError e, Session session) =>
     {
         callback?.Invoke(e, CobrowseSessionImplementation.TryCreate(session));
     });
 }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public void SetRemoteControl(Abstractions.RemoteControlState state, CobrowseCallback callback)
        {
            RemoteControlState toBeSet;

            switch (state)
            {
            case Abstractions.RemoteControlState.Off:
                toBeSet = RemoteControlState.Off;
                break;

            case Abstractions.RemoteControlState.Requested:
                toBeSet = RemoteControlState.Requested;
                break;

            case Abstractions.RemoteControlState.Rejected:
                toBeSet = RemoteControlState.Rejected;
                break;

            case Abstractions.RemoteControlState.On:
                toBeSet = RemoteControlState.On;
                break;

            default:
                toBeSet = default;
                break;
            }

            _platformSession.SetRemoteControl(toBeSet, (JError e, Session session) =>
            {
                callback?.Invoke(e, CobrowseSessionImplementation.TryCreate(session));
            });
        }
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public void SetFullDevice(bool value, CobrowseCallback callback)
 {
     _platformSession.SetFullDevice(value, (JError e, Session session) =>
     {
         callback?.Invoke(e, CobrowseSessionImplementation.TryCreate(session));
     });
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Ends the session.
 /// </summary>
 public void End(CobrowseCallback callback)
 {
     _platformSession.End((JError e, Session session) =>
     {
         callback?.Invoke(e, CobrowseSessionImplementation.TryCreate(session));
     });
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Activates the session.
 /// </summary>
 public void Activate(CobrowseCallback callback)
 {
     _platformSession.Activate((NSError e, Session session) =>
     {
         callback?.Invoke(e?.AsException(), CobrowseSessionImplementation.TryCreate(session));
     });
 }