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
 /// <summary>
 /// Ends the session.
 /// </summary>
 public void End(CobrowseCallback callback)
 {
     _platformSession.End((JError e, Session session) =>
     {
         callback?.Invoke(e, CobrowseSessionImplementation.TryCreate(session));
     });
 }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public void SetFullDevice(bool value, CobrowseCallback callback)
 {
     _platformSession.SetFullDevice(value, (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));
     });
 }
Ejemplo n.º 6
0
        internal bool RaiseSessionDidLoad(Session session)
        {
            var sessionDidLoad = SessionDidLoad;

            if (sessionDidLoad != null)
            {
                sessionDidLoad(this, CobrowseSessionImplementation.TryCreate(session));
                return(true);
            }
            return(false);
        }
Ejemplo n.º 7
0
        internal bool RaiseRemoteControlRequest(Session session)
        {
            var remoteControlRequest = RemoteControlRequest;

            if (remoteControlRequest != null)
            {
                remoteControlRequest(this, CobrowseSessionImplementation.TryCreate(session));
                return(true);
            }
            return(false);
        }
Ejemplo n.º 8
0
        internal bool RaiseSessionDidRequest(Session session)
        {
            var sessionDidRequest = SessionDidRequest;

            if (sessionDidRequest != null)
            {
                sessionDidRequest(this, CobrowseSessionImplementation.TryCreate(session));
                return(true);
            }
            return(false);
        }