Пример #1
0
        private void StartClient(string activityManagerHttpAddress)
        {
            var path = GetExternalFilesDir("ActivityCloud").AbsolutePath;
            SetStatus("Connecting to Activity Manager on " + activityManagerHttpAddress);
            _client = new ActivityClient(path, _device) { CurrentUser = _user };

            _client.ActivityAdded += OnActivityAdded;
            _client.ActivityChanged += OnActivityChanged;
            _client.ActivityRemoved += OnActivityRemoved;
            _client.MessageReceived += OnMessageReceived;

            _client.FriendAdded += OnFriendAdded;
            _client.FriendDeleted += OnFriendDeleted;
            _client.FriendRequestReceived += OnFriendRequestReceived;

            _client.FileAdded += OnFileAdded;
            _client.FileRemoved += OnFileRemoved;

            _client.ConnectionEstablished += OnConnectionEstablished;

            _client.Open(activityManagerHttpAddress);
        }
Пример #2
0
 private void StartRoleChangeProcedure(string addr)
 {
     try
     {
         var actCli = new ActivityClient(@"c:/abcdesk/", _device) { CurrentUser = new User() };
         actCli.ConnectionEstablished += ActCliConnectionEstablished;
         actCli.Open(addr);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #3
0
        /// <summary>
        /// Starts the activity client based on a given http address
        /// </summary>
        /// <param name="activityManagerHttpAddress"></param>
        private void StartClient(string activityManagerHttpAddress)
        {
            _client = new ActivityClient( @"c:/abc/",_device) {CurrentUser = _owner};

            _client.ActivityAdded += ClientActivityAdded;
            _client.ActivityChanged += ClientActivityChanged;
            _client.ActivityRemoved += ClientActivityRemoved;
            _client.ActivitySwitched += ClientActivitySwitched;

            _client.MessageReceived += ClientMessageReceived;

            _client.FriendAdded += client_FriendAdded;
            _client.FriendDeleted += client_FriendDeleted;
            _client.FriendRequestReceived += ClientFriendRequestReceived;

            _client.ConnectionEstablished += ClientConnectionEstablished;
            _client.ServiceIsDown += ClientServiceIsDown;
            _client.ContextMonitor.AddContextService(new InputRedirect(PointerRole.Controller));
            _client.ContextMessageReceived += _client_ContextMessageReceived;

            _client.Open(activityManagerHttpAddress);
        }
Пример #4
0
        private void StartClient(string addr,string tag)
        {
            if (_pairedManager == null)
            {
                try
                {
                    _pairedTag = tag;
                    _pairedManager = new ActivityClient(@"c:/abcdesk/", _device) { CurrentUser = new User() };
                    _pairedManager.ActivityAdded += ClientActivityAdded;
                    _pairedManager.ActivityRemoved += ClientActivityRemoved;
                    _pairedManager.FileAdded += new FileAddedHandler(_client_FileAdded);
                    _pairedManager.ServiceIsDown += new ServiceDownHandler(_client_ServiceIsDown);
                    _pairedManager.ActivitySwitched += new ActivitySwitchedHandler(_client_ActivitySwitched);
                    _pairedManager.DeviceAdded += new DeviceAddedHandler(_pairedManager_DeviceAdded);
                    _pairedManager.Open(addr);
                    InitializeUI();
                }
                catch (Exception ex)
                {

                    MessageBox.Show(ex.ToString());
                }
            }
            else if (tag != _pairedTag)
            {
                StartRoleChangeProcedure(addr);
                return;
            }

        }
Пример #5
0
        private void StartClient(string addr)
        {
            if (_client != null)
                return;
            try
            {
                Dispatcher.Invoke(DispatcherPriority.Background, new System.Action(() =>
                {
                    activityStack.Children.Clear();
                    activityMatrix.Children.Clear();
                }));
                _client = new ActivityClient(@"c:/abc/", _device) { CurrentUser = new User() };
                _client.MessageReceived += ClientMessageReceived;
                _client.ActivityAdded += ClientActivityAdded;
                _client.ActivityRemoved += ClientActivityRemoved;
                _client.ConnectionEstablished += ClientConnectionEstablished;
                _client.FileAdded += ClientFileAdded;
                _client.ActivitySwitched += ClientActivitySwitched;
                
                _client.Open(addr);
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.ToString());
            }
        }