• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ProgressBar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ProgressBar的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar类的具体用法?C# ProgressBar怎么用?C# ProgressBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProgressBar类属于命名空间,在下文中一共展示了ProgressBar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ProgressDialog

	public ProgressDialog (string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window)
	{
		Title = title;
		this.total_count = total_count;

		if (parent_window != null)
			this.TransientFor = parent_window;

		HasSeparator = false;
		BorderWidth = 6;
		SetDefaultSize (300, -1);

		message_label = new Label (String.Empty);
		VBox.PackStart (message_label, true, true, 12);

		progress_bar = new ProgressBar ();
		VBox.PackStart (progress_bar, true, true, 6);

		switch (cancel_button_type) {
		case CancelButtonType.Cancel:
			button = (Gtk.Button)AddButton (Gtk.Stock.Cancel, (int) ResponseType.Cancel);
			break;
		case CancelButtonType.Stop:
			button = (Gtk.Button)AddButton (Gtk.Stock.Stop, (int) ResponseType.Cancel);
			break;
		}

		Response += new ResponseHandler (HandleResponse);
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:29,代码来源:ProgressDialog.cs


示例2: Start

    void Start()
    {
        timer = FindObjectOfType(typeof(ProgressBar)) as ProgressBar;

        if (timer == null)
            Debug.LogError ("No Timer, dude");
    }
开发者ID:kjuik,项目名称:ChainJam2014,代码行数:7,代码来源:ShaderAnimator.cs


示例3: onCreate

		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.uploader;

			mTargetDevicePicker = (DevicePicker) FragmentManager.findFragmentById(R.id.targetPicker);
			mTargetDevicePicker.DeviceType = SmcDevice.TYPE_PROVIDER;
			mTargetDevicePicker.DeviceSelectedListener = this;
			mUploadButton = (Button) findViewById(R.id.button);
			mUploadButton.OnClickListener = uploadClickListener;
			progressBar = (ProgressBar) findViewById(R.id.progress);


			SmcItem.LocalContent content = LocalContent;

			if (content == null)
			{
				Toast.makeText(this, "Content not supported", Toast.LENGTH_SHORT).show();
				this.finish();
			}
			else
			{
				itemToUpload = new SmcItem(content);
				((TextView)findViewById(R.id.header)).Text = "File: " + itemToUpload.Uri.ToString();
			}
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:26,代码来源:Uploader.cs


示例4: Main

        private static void Main(string[] args)
        {
            Console.WriteLine("Performing some task... ");
            using (var progress = new ProgressBar<SimpleProgressInfo>())
            using (new DoubleProgressAdapter(progress, "1"))
            using (ProgressScope.Start("1", 0, 1, "Starting"))
            {
                Thread.Sleep(1000);
                ProgressScope.Report(0.1, "One");
                Thread.Sleep(1000);
                ProgressScope.Report(0.2);
                Thread.Sleep(1000);
                using (ProgressScope.Start("2", 0.3, 0.45))
                {
                    Thread.Sleep(1000);
                    ProgressScope.Report(0.33);
                    Thread.Sleep(1000);
                    ProgressScope.Report(0.66, "tu");
                    Thread.Sleep(1000);
                }
                Thread.Sleep(1000);
                ProgressScope.Report(0.6, "Almost");
                Thread.Sleep(1000);
                ProgressScope.Report(0.8);
                Thread.Sleep(1000);
            }
            Console.WriteLine("Done.");

            Console.ReadKey();
        }
开发者ID:wooboo,项目名称:AyProgress,代码行数:30,代码来源:Program.cs


示例5: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.SearchActivity);

            searchViewModel = new SearchViewModel (Android.Application.Service, new Search ("Default")) {
                GroupByLastName = false,
            };
            searchViewModel.SearchCompleted += HandleSearchCompleted;

            progressBar = FindViewById<ProgressBar> (Resource.Id.progressBar1);
            searchingText = FindViewById<TextView> (Resource.Id.emptyTextView);

            ListAdapter = new PeopleGroupsAdapter () {
                ItemsSource = searchViewModel.Groups,
            };

            // Start the search
            var intent = Intent;
            if (!Intent.ActionSearch.Equals (intent.Action))
                return;

            searchViewModel.SearchText = intent.GetStringExtra (SearchManager.Query);
            searchViewModel.SearchProperty = SearchProperty.All;
            searchViewModel.Search ();
        }
开发者ID:tranuydu,项目名称:prebuilt-apps,代码行数:27,代码来源:SearchActivity.cs


示例6: AddSpinner

        public void AddSpinner(ViewGroup rootview,string loadingtext)
        {
            loading = true;
            if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
                loadingcontainer = new RelativeLayout (nn_activity);
                loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                loadingcontainer.SetBackgroundColor (Color.White);

                var detailcontainer = new LinearLayout (nn_activity);

                detailcontainer.Orientation = Orientation.Vertical;
                RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent);
                param.AddRule (LayoutRules.CenterInParent);
                detailcontainer.LayoutParameters = param;

                LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
                linearlayoutparm.Gravity = GravityFlags.CenterHorizontal;

                ProgressBar progressbar = new ProgressBar (nn_activity);
                progressbar.LayoutParameters = linearlayoutparm;

                TextView tectview = new TextView (nn_activity);
                tectview.LayoutParameters = linearlayoutparm;
                tectview.Text = loadingtext;
                tectview.Gravity = GravityFlags.CenterHorizontal;

                detailcontainer.AddView (progressbar);
                detailcontainer.AddView (tectview);

                loadingcontainer.AddView (detailcontainer);
                rootview.AddView (loadingcontainer);
            }
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:33,代码来源:Tap5050Fragment.cs


示例7: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

              var login = FindViewById<Button>(Resource.Id.login);
              AuthenticationHelper.PlatformParameters = new PlatformParameters(this);
              progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar);
              progressBar.Indeterminate = true;
              progressBar.Visibility = ViewStates.Invisible;

              login.Click += async (sender, args) =>
            {
              login.Enabled = false;
              progressBar.Visibility = ViewStates.Visible;

              var client = await AuthenticationHelper.GetCalendarClient();

              progressBar.Visibility = ViewStates.Invisible;
              login.Enabled = true;
              if (client == null)
              {
            Toast.MakeText(this, "Login failed", ToastLength.Long).Show();
            return;
              }

              StartActivity(typeof(MainActivity));
              Finish();
            };

              if(Settings.TenantId != "common")
              {
            StartActivity(typeof(MainActivity));
            Finish();
              }
        }
开发者ID:gxy001,项目名称:Office365-FiveMinuteMeeting,代码行数:35,代码来源:LoginActivity.cs


示例8: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
			var rootView = inflater.Inflate(Resource.Layout.Settings, container, false);
			cbNLT = rootView.FindViewById<CheckBox> (Resource.Id.ckboxRemindLT);
			cbUpdate=rootView.FindViewById<CheckBox> (Resource.Id.ckboxAutoUpdateData);
			btupdateData=rootView.FindViewById<Button> (Resource.Id.btUpdateData);
			progressup=rootView.FindViewById<ProgressBar> (Resource.Id.proUpdateData);
			txtResult = rootView.FindViewById<TextView> (Resource.Id.txtresult);
			progressNL=rootView.FindViewById<ProgressBar> (Resource.Id.proNL);
			//About
			TextView txtVersion = rootView.FindViewById<TextView> (Resource.Id.txtVersion_Set);
			txtVersion.Click += TxtVersion_Click;
			Bundle bundle=this.Arguments;
			bool check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");
			cbUpdate.Checked = autoupdate;
			cbNLT.Checked = check;
			btupdateData.Click+= BtupdateData_Click;
			cbNLT.CheckedChange += CbNLT_CheckedChange;
			cbUpdate.CheckedChange+= CbUpdate_CheckedChange;
			if (cbUpdate.Checked) {
				btupdateData.SetBackgroundResource (Android.Resource.Color.DarkerGray);
			}

			else
			{
				btupdateData.SetBackgroundResource (Android.Resource.Color.HoloBlueDark);
			}
			btupdateData.Enabled = !cbUpdate.Checked;
			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:33,代码来源:SettingsFragment.cs


示例9: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            var client = new GitHubOrganisationEventClient();

            // Alternative: Globale Events statt Organisation events anzeigen
            // var client = new GitHubGlobalEventClient();

            var service = new GitHubEventService(client);
            var browserTask = new AndroidBrowserTask(this);

            _viewModel = new GitHubEventListViewModel(service, browserTask);
            _adapter = new GitHubEventListAdapter(this, _viewModel);

            Button button = FindViewById<Button>(Resource.Id.main_button_refresh);
            Button buttonWebsite = FindViewById<Button>(Resource.Id.main_button_website);
            ListView listView = FindViewById<ListView>(Resource.Id.main_listview);

            _progressBar = FindViewById<ProgressBar>(Resource.Id.main_progressBar);

            button.Click += Button_Click;
            buttonWebsite.Click += (o, e) => { _viewModel.GoToGithubDotCom(); };
            listView.Adapter = _adapter;

            _viewModel.PropertyChanged += viewModel_PropertyChanged;

            UpdateViews(String.Empty);
        }
开发者ID:KaiBrummund,项目名称:GitExplorer,代码行数:30,代码来源:MainActivity.cs


示例10: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            /* Layout attributen toewijzen aan code */
            SetContentView(Resource.Layout.Main);
            mBtnLogin = FindViewById<Button>(Resource.Id.btn_login);
            mBtnRegistreer = FindViewById<Button>(Resource.Id.btn_registreer);
            mProgressbar = FindViewById<ProgressBar>(Resource.Id.progressBar1);

            /* Click events */
            mBtnLogin.Click += (object sender, EventArgs args) =>
            {
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                Dialog_inloggen inlogdialog = new Dialog_inloggen();
                inlogdialog.Show(transaction, "dialog fragment");

                inlogdialog.logincompleet += Inlogdialog_logincompleet;

            };
            mBtnRegistreer.Click += (object sender, EventArgs args) => //Click methode in zelfde methode
            {
                // dialog weergeven
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                Dialog_registreer regdialog = new Dialog_registreer();
                regdialog.Show(transaction, "dialog fragment");

                regdialog.registreerCompleet += Regdialog_registreerCompleet;
            };
        }
开发者ID:Ascanius95,项目名称:Bringware,代码行数:30,代码来源:MainActivity.cs


示例11: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            RequestWindowFeature (WindowFeatures.ActionBarOverlay);
            ActionBar.SetBackgroundDrawable (new ColorDrawable (Color.Transparent));
            SetContentView (Resource.Layout.Main);

            var list = FindViewById<OverscrollListView> (Resource.Id.listView1);
            loadingBars = FindViewById<LinearLayout> (Resource.Id.loadingBars);
            bar1 = FindViewById<ProgressBar> (Resource.Id.loadingBar1);
            bar2 = FindViewById<ProgressBar> (Resource.Id.loadingBar2);
            swipeText = FindViewById<TextView> (Resource.Id.swipeToRefreshText);

            // Remove progress bar background
            foreach (var p in new[] { bar1, bar2 }) {
                var layer = p.ProgressDrawable as LayerDrawable;
                if (layer != null)
                    layer.SetDrawableByLayerId (Android.Resource.Id.Background,
                                                new ColorDrawable (Color.Transparent));
            }

            list.OverScrolled += deltaY => {
                ShowSwipeDown ();

                accumulatedDeltaY += -deltaY;
                bar1.Progress = bar2.Progress = accumulatedDeltaY;
                if (accumulatedDeltaY == 0)
                    HideSwipeDown ();
            };
            list.OverScrollCanceled += HideSwipeDown;
        }
开发者ID:penpan85,项目名称:SwipeDownToRefresh,代码行数:32,代码来源:MainActivity.cs


示例12: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView (inflater, container, savedInstanceState);
            var view = inflater.Inflate (Resource.Layout.Tab1, container, false);

            var list = view.FindViewById<OverscrollListView> (Resource.Id.listView1);
            loadingBars = view.FindViewById<LinearLayout> (Resource.Id.loadingBars);
            bar1 = view.FindViewById<ProgressBar> (Resource.Id.loadingBar1);
            bar2 = view.FindViewById<ProgressBar> (Resource.Id.loadingBar2);
            swipeText = view.FindViewById<TextView> (Resource.Id.swipeToRefreshText);
            fakeActionBar = view.FindViewById<FrameLayout> (Resource.Id.fakeActionBar);

            // Remove progress bar background
            foreach (var p in new[] { bar1, bar2 }) {
                var layer = p.ProgressDrawable as LayerDrawable;
                if (layer != null)
                    layer.SetDrawableByLayerId (Android.Resource.Id.Background,
                                                new ColorDrawable (Color.Transparent));
            }

            list.OverScrolled += deltaY => {
                ShowSwipeDown ();

                accumulatedDeltaY += -deltaY;
                bar1.Progress = bar2.Progress = accumulatedDeltaY;
                if (accumulatedDeltaY == 0)
                    HideSwipeDown ();
            };
            list.OverScrollCanceled += HideSwipeDown;

            return view;
        }
开发者ID:jheerman,项目名称:CustomActionBar,代码行数:32,代码来源:Fragment1.cs


示例13: Start

 void Start()
 {
     ingredients = GameObject.FindGameObjectsWithTag("Ingredient");
     pie = GameObject.FindObjectOfType<Pie>().GetComponent<Pie>();
     progressBar = GameObject.FindObjectOfType<ProgressBar>().GetComponent<ProgressBar>();
     gameController = GameObject.FindObjectOfType<GameController>().GetComponent<GameController>();
 }
开发者ID:kai91,项目名称:PiJam,代码行数:7,代码来源:InputHandler.cs


示例14: BindDataToView

		public void BindDataToView(Post post, bool setHeight = false, ProgressBar progressBar = null, Action callBack = null)
		{
			Setup();
			Clickable = false;

			ImageService.Instance.LoadUrl(StringUtils.GetPostImageURL(post))
				.Retry(3, 200)
				.DownSample((Width == 0) ? TabHostActivity.GetTabHost().ScreenWidth : Width, 0)
				.FadeAnimation(true)
				.TransparencyChannel(false)
				.Transform(new RoundedTransformation(20, 0, 0))
				.Success((FFImageLoading.Work.ImageInformation arg1, FFImageLoading.Work.LoadingResult arg2) =>
				{
					if (progressBar != null)
					{
						progressBar.Visibility = ViewStates.Gone;
					}
					if (setHeight)
					{
						if (arg1.OriginalHeight > Width)
						{
							LayoutParameters.Height = (int)((float)arg1.OriginalHeight / (float)arg1.OriginalWidth * (float)((Width == 0) ? TabHostActivity.GetTabHost().ScreenWidth - 20 : Width));
						}
						else {
							LayoutParameters.Height = (int)arg1.OriginalHeight;
						}
						RequestLayout();
						if (callBack != null)
						{
							callBack();
						}
					}
				})
				.Into(this);
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:35,代码来源:WebImage.cs


示例15: OnCreate

    protected async override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);

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

      progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar);

      viewModel = ServiceContainer.Resolve<ExpensesViewModel>();
      viewModel.IsBusyChanged = (busy) =>
      {
        progressBar.Visibility = busy ? ViewStates.Visible : ViewStates.Gone;
      };

      ListAdapter = new ExpenseAdapter(this, viewModel);
     
      ListView.ItemLongClick += async (sender, args) =>
      {
        await viewModel.ExecuteDeleteExpenseCommand(viewModel.Expenses[args.Position]);
        RunOnUiThread(() => ((ExpenseAdapter)ListAdapter).NotifyDataSetChanged());
      };

      if (!viewModel.IsSynced)
      {
        await Authenticate();
        await viewModel.ExecuteSyncExpensesCommand();
        RunOnUiThread(() => ((ExpenseAdapter)ListAdapter).NotifyDataSetChanged());
      }
      
    }
开发者ID:jv9,项目名称:MyExpenses,代码行数:31,代码来源:ExpensesActivity.cs


示例16: Initialize

        public override void Initialize()
        {
            base.Initialize();

            Label message = new Label("Charging...");
            AddComponent(message, 0, 100);

            Button shot = new Button("Shot!");
            shot.Pressed += delegate
            {
                if (charged)
                {
                    charger.Value = 0;
                    charged = false;
                    message.Text = "Charging...";
                }
            };
            AddComponent(shot, 150, 100);

            charger = new ProgressBar();
            charger.Value = 0;
            charger.EndEvent += delegate
            {
                charged = true;
                message.Text = "Charged!";
            };
            AddComponent(charger, 0, 0);
        }
开发者ID:Syderis,项目名称:CellSDK-Tutorials,代码行数:28,代码来源:MainScreen.cs


示例17: OnCreate

		protected override void OnCreate (Bundle icicle)
		{
			//base.OnCreate(icicle);
			if (!LibsChecker.CheckVitamioLibs (this))
				return;
			SetContentView (Resource.Layout.videobuffer);
			mVideoView = FindViewById<VideoView> (Resource.Id.buffer);
			pb = FindViewById<ProgressBar> (Resource.Id.probar);

			downloadRateView = FindViewById<TextView> (Resource.Id.download_rate);
			loadRateView = FindViewById<TextView> (Resource.Id.load_rate);
			if (path == "") {
				// Tell the user to provide a media file URL/path.
				Toast.MakeText (this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show ();
				return;
			} else {
				//      
				//       * Alternatively,for streaming media you can use
				//       * mVideoView.setVideoURI(Uri.parse(URLstring));
				//       
				uri = Android.Net.Uri.Parse (path);
				mVideoView.SetVideoURI (uri);
				mVideoView.SetMediaController (new MediaController (this));
				mVideoView.RequestFocus ();
				mVideoView.SetOnInfoListener (this);
				mVideoView.SetOnBufferingUpdateListener (this);
				mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => {
					e.P0.SetPlaybackSpeed(1.0f);
				};
			}
		}
开发者ID:shaxxx,项目名称:Xamarin.Vitamio,代码行数:31,代码来源:VideoViewBuffer.cs


示例18: OnCreate

 protected override void OnCreate(Bundle bundle) {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.card_kitty);
     kittyImageView = (ImageView)FindViewById(Resource.Id.kittyImage);
     kittyProgressBar = (ProgressBar)FindViewById(Resource.Id.kittyProgress);
     gestureDetector = new GestureDetector(this);
 }
开发者ID:patridge,项目名称:OkGlassFindACat,代码行数:7,代码来源:RandomKittyActivity.cs


示例19: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);

			 rootView = inflater.Inflate(Resource.Layout.HocPhi, container, false);

			Bundle bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressHP);
			listView = rootView.FindViewById<ListView>(Resource.Id.listHP);
			txtHocKyHP = rootView.FindViewById<TextView>(Resource.Id.txtHocKyHP);
			 txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_HP);
			linear = rootView.FindViewById<LinearLayout> (Resource.Id.linear10);
			//load data
		
		
			progress.Visibility = ViewStates.Visible;
			progress.Indeterminate = true;
			//progress.Indeterminate = true;
			LoadData ();

			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:26,代码来源:HocPhiFragment.cs


示例20: Dictionary

    public Dictionary(int cue, ProgressBar pBar)
    {
        bl = new BL();
        DataTable dt = bl.GetAllTrainingSet();

        switch (cue)
        {
            case 1:
                // Get All Words
                PopulateWordsTables(dt, pBar);
                break;
            case 2:
                // Preliminary Terms
                //DataTable
                //GetTerms(
                GetTermFrequencyData(pBar);
                break;
            case 3:
                // Create Dictionary
                CreateDictionary(pBar);
                break;
            case 4:
                // Create Features Sets
                HandleExtraInfo(pBar);
                break;
        }// Switch
    }
开发者ID:ruppinserver,项目名称:Dances_Words_Algorithm,代码行数:27,代码来源:Dictionary.cs



注:本文中的ProgressBar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProgressCallback类代码示例发布时间:2022-05-24
下一篇:
C# Progress类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap