public void LoadtypeScanHandle()
        {
            AlertDialog.Builder MsBox = new AlertDialog.Builder(this);
            MsBox.SetTitle("اسکن دستی");
            View ViewMs = View.Inflate(this, Resource.Layout.LayoutHandleScan, null);

            MsBox.SetView(ViewMs);
            //start view
            TextView TextNat       = (TextView)ViewMs.FindViewById(Resource.Id.LHandleScanTextViewMN);
            SeekBar  SeekBarSen    = (SeekBar)ViewMs.FindViewById(Resource.Id.LHandleScanSeekBarSen);
            SeekBar  SeekBarPower  = (SeekBar)ViewMs.FindViewById(Resource.Id.LHandleScanSeekBarPower);
            Spinner  SpSpeedsensor = (Spinner)ViewMs.FindViewById(Resource.Id.LHandleScanSpinnerSpeed);

            string[] HanItemSpSpeed         = new string[] { "کم", "متوسط", "زیاد" };
            ArrayAdapter <string> SIAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, HanItemSpSpeed);

            SpSpeedsensor.Adapter       = SIAdapter;
            SpSpeedsensor.ItemSelected += delegate
            {
                switch (SpSpeedsensor.SelectedItemPosition)
                {
                case 0:
                    AutoHanSpeedSensor = SensorStatus.AccuracyLow;
                    break;

                case 1:
                    AutoHanSpeedSensor = SensorStatus.AccuracyMedium;
                    break;

                case 2:
                    AutoHanSpeedSensor = SensorStatus.AccuracyHigh;
                    break;

                default:
                    break;
                }
            };

            SeekBarSen.ProgressChanged += delegate
            {
                TextNat.Text = "حساسیت فلزات : " + SeekBarSen.Progress + "  *  " + "قدرت سنسور : " + SeekBarPower.Progress;
                HanSen       = SeekBarSen.Progress;
            };

            SeekBarPower.ProgressChanged += delegate
            {
                TextNat.Text = "حساسیت فلزات : " + SeekBarSen.Progress + "  *  " + "قدرت سنسور : " + SeekBarPower.Progress;
                HanPower     = SeekBarPower.Progress;
            };

            //end view
            MsBox.SetCancelable(false);
            MsBox.SetPositiveButton("اجرا", delegate
            {
                typeScan = TypeScanMD.Handle;
                Toast.MakeText(this, "اسکن دستی فعال شد", ToastLength.Short).Show();
            });
            MsBox.SetNegativeButton("لغو", delegate { SpinnerTypeScan.SetSelection(0); });
            MsBox.Create(); MsBox.Show();
        }
        public void LoadTypeScanCustom()
        {
            AlertDialog.Builder MsBox = new AlertDialog.Builder(this);
            MsBox.SetTitle("اسکن سفارشی");
            View ViewMs = View.Inflate(this, Resource.Layout.LayoutCustomScan, null);

            MsBox.SetView(ViewMs);
            Spinner SpB = (Spinner)ViewMs.FindViewById(Resource.Id.LCusScanSpinnerBord);
            Spinner SpD = (Spinner)ViewMs.FindViewById(Resource.Id.LCusScanSpinnerDegat);

            string[] itemSB          = new string[] { "حداقل", "متوسط", "حداکثر", "حداکثر ++" };
            string[] itemSD          = new string[] { "کم", "متوسط", "زیاد" };
            ArrayAdapter <string> IB = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, itemSB);
            ArrayAdapter <string> ID = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, itemSD);

            SpB.Adapter = IB; SpD.Adapter = ID;

            SpB.ItemSelected += delegate
            {
                CusB = SpB.SelectedItemPosition;
            };
            SpD.ItemSelected += delegate
            {
                CusD = SpD.SelectedItemPosition;
            };

            MsBox.SetCancelable(false);
            MsBox.SetPositiveButton("اجرا", delegate
            {
                typeScan = TypeScanMD.Custom;
                Toast.MakeText(this, "اسکن سفارشی فعال شد", ToastLength.Short).Show();
                ProgressMain.Progress = 0;
            });
            MsBox.SetNegativeButton("لغو", delegate { SpinnerTypeScan.SetSelection(0); });
            MsBox.Create(); MsBox.Show();
        }
 public void LoadTypeScanAuto()
 {
     Toast.MakeText(this, "اسکن اتوماتیک فعال شد", ToastLength.Short).Show();
     typeScan = TypeScanMD.Auto;
 }