Esempio n. 1
0
        public static ClipboardInterface GetInstance()
        {
            if (instance == null)
            {
                instance = new ClipboardInterface();
            }

            return(instance);
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            ClipboardInterface.GetInstance().SetClipboardManager((ClipboardManager)GetSystemService(Context.ClipboardService));

            commManager = CommunicationManger.GetInstance();

            txtState    = FindViewById <TextView>(Resource.Id.txtState);
            progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar1);
            var searchBtn = FindViewById <Button>(Resource.Id.searchBtn);

            txtState.Text          = "Searching for server";
            txtState.Visibility    = ViewStates.Gone;
            progressBar.Visibility = ViewStates.Gone;

            searchBtn.Click += (sender, args) => SearchServer(30);
            onSearchEnd     += SearchEnded;

            if (!commManager.IsBluetoothExists())
            {
                Console.WriteLine("finished");
                Toast.MakeText(this, "No bluetooth adapter found", ToastLength.Long);
                Finish();
                return;
            }

            if (!commManager.IsBluetoothOn())
            {
                Intent enableIntent = new Intent(BluetoothAdapter.ActionRequestEnable);
                StartActivityForResult(enableIntent, 2);
            }

            Console.WriteLine("finished setup");
        }
Esempio n. 3
0
        private void TxtPassOnLongClick(object sender, View.LongClickEventArgs longClickEventArgs)
        {
            ClipboardInterface.GetInstance().CopyToClipboard(pass);

            Toast.MakeText(this.Activity, "copied", ToastLength.Short).Show();
        }