Exemplo n.º 1
0
 public AsyncTouch(AsyncCluster cluster, WritePolicy writePolicy, WriteListener listener, Key key)
     : base(cluster, writePolicy, new Partition(key), false)
 {
     this.writePolicy = writePolicy;
     this.listener    = listener;
     this.key         = key;
 }
Exemplo n.º 2
0
 public AsyncTouch(AsyncTouch other)
     : base(other)
 {
     this.writePolicy = other.writePolicy;
     this.listener    = other.listener;
     this.key         = other.key;
 }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Title = "마우스";
            SetContentView(Resource.Layout.activity_main);
            navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);
            navigation.SetOnNavigationItemSelectedListener(this);

            if (savedInstanceState == null)
            {
                Fragment fragment = ItemOneFragment.NewInstance(chatService);
                FragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, fragment)
                .Commit();
            }

            //SetHasOptionsMenu(true);
            bluetoothAdapter = BluetoothAdapter.DefaultAdapter;


            receiver = new DiscoverableModeReceiver();
            receiver.BluetoothDiscoveryModeChanged += (sender, e) =>
            {
                this.InvalidateOptionsMenu();
            };

            if (bluetoothAdapter == null)
            {
                Toast.MakeText(this, "Bluetooth is not available.", ToastLength.Long).Show();
                this.FinishAndRemoveTask();
            }

            writeListener = new WriteListener(this);
            handler       = new ChatHandler(this);
        }
Exemplo n.º 4
0
 public AsyncTouch(AsyncCluster cluster, WritePolicy writePolicy, WriteListener listener, Key key)
     : base(cluster, writePolicy, false)
 {
     this.writePolicy = writePolicy;
     this.listener    = listener;
     this.key         = key;
     this.partition   = Partition.Write(cluster, policy, key);
 }
Exemplo n.º 5
0
 public AsyncTouch(AsyncCluster cluster, WritePolicy policy, WriteListener listener, Key key)
     : base(cluster)
 {
     this.policy    = policy;
     this.listener  = listener;
     this.key       = key;
     this.partition = new Partition(key);
 }
Exemplo n.º 6
0
 public AsyncTouch(AsyncCluster cluster, WritePolicy policy, WriteListener listener, Key key)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
 }
Exemplo n.º 7
0
 public AsyncWrite(AsyncWrite other)
     : base(other)
 {
     this.writePolicy = other.writePolicy;
     this.listener    = other.listener;
     this.key         = other.key;
     this.bins        = other.bins;
     this.operation   = other.operation;
 }
Exemplo n.º 8
0
 public AsyncWrite(AsyncCluster cluster, WritePolicy writePolicy, WriteListener listener, Key key, Bin[] bins, Operation.Type operation)
     : base(cluster, writePolicy, new Partition(key), false)
 {
     this.writePolicy = writePolicy;
     this.listener    = listener;
     this.key         = key;
     this.bins        = bins;
     this.operation   = operation;
 }
 public AsyncWrite(AsyncCluster cluster, WritePolicy policy, WriteListener listener, Key key, Bin[] bins, Operation.Type operation)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
     this.bins = bins;
     this.operation = operation;
 }
Exemplo n.º 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _bluetoothAdapter = BluetoothAdapter.DefaultAdapter;
            SetContentView(Resource.Layout.content_main);

            _writeListener = new WriteListener(this);

            if (_bluetoothAdapter == null)
            {
                Toast.MakeText(this, "Bluetooth is not available.", ToastLength.Long).Show();
                FinishAndRemoveTask();
            }

            _receiver.BluetoothDiscoveryModeChanged += (sender, e) => { InvalidateOptionsMenu(); };

            InitializeFragments();
        }
Exemplo n.º 11
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetHasOptionsMenu(true);
            bluetoothAdapter = BluetoothAdapter.DefaultAdapter;


            receiver = new DiscoverableModeReceiver();
            receiver.BluetoothDiscoveryModeChanged += (sender, e) =>
            {
                Activity.InvalidateOptionsMenu();
            };

            if (bluetoothAdapter == null)
            {
                Toast.MakeText(Activity, "Bluetooth is not available.", ToastLength.Long).Show();
                Activity.FinishAndRemoveTask();
            }

            writeListener = new WriteListener(this);
            handler       = new ChatHandler(this);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Asynchronously append bin string values to existing record bin values.
 /// Schedule the append command with a channel selector and return.
 /// Another thread will process the command and send the results to the listener.
 /// <para>
 /// The policy specifies the transaction timeout, record expiration and how the transaction is
 /// handled when the record already exists.
 /// This call only works for string values. 
 /// </para>
 /// </summary>
 /// <param name="policy">write configuration parameters, pass in null for defaults</param>
 /// <param name="listener">where to send results, pass in null for fire and forget</param>
 /// <param name="key">unique record identifier</param>
 /// <param name="bins">array of bin name/value pairs</param>
 /// <exception cref="AerospikeException">if queue is full</exception>
 public void Append(WritePolicy policy, WriteListener listener, Key key, params Bin[] bins)
 {
     if (policy == null)
     {
         policy = writePolicyDefault;
     }
     AsyncWrite async = new AsyncWrite(cluster, policy, listener, key, bins, Operation.Type.APPEND);
     async.Execute();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Asynchronously create record if it does not already exist.
 /// Schedule the touch command with a channel selector and return.
 /// Another thread will process the command and send the results to the listener.
 /// If the record exists, the record's time to expiration will be reset to the policy's 
 /// expiration.
 /// </summary>
 /// <param name="policy">write configuration parameters, pass in null for defaults</param>
 /// <param name="listener">where to send results, pass in null for fire and forget</param>
 /// <param name="key">unique record identifier</param>
 /// <exception cref="AerospikeException">if queue is full</exception>
 public void Touch(WritePolicy policy, WriteListener listener, Key key)
 {
     if (policy == null)
     {
         policy = writePolicyDefault;
     }
     AsyncTouch async = new AsyncTouch(cluster, policy, listener, key);
     async.Execute();
 }