当前位置: 首页>>代码示例>>C#>>正文


C# IMenuItem.SetTitle方法代码示例

本文整理汇总了C#中IMenuItem.SetTitle方法的典型用法代码示例。如果您正苦于以下问题:C# IMenuItem.SetTitle方法的具体用法?C# IMenuItem.SetTitle怎么用?C# IMenuItem.SetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMenuItem的用法示例。


在下文中一共展示了IMenuItem.SetTitle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnOptionsItemSelected

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch(item.ItemId)
            {
                case Resource.Id.menuSettings:
                    Intent setIntent = new Intent(this, typeof(Settings));
                    StartActivityForResult(setIntent, 0);
                    break;

                case Resource.Id.menuGetDataNow:
                    new FeedHelper().UpdateBGFeeds(this);
                    break;

                case Resource.Id.menuShowReadNews:
                    showOnlyUnreadNews = !showOnlyUnreadNews;

                    LoadNews();

                    if (!showOnlyUnreadNews)
                        item.SetTitle("Ungelesene News");
                    else
                        item.SetTitle("Alle News");
                    break;

                case Resource.Id.menuMarkAllRead:
                    new de.dhoffmann.mono.adfcnewsapp.buslog.database.Rss().MarkItemsAsRead(null, true);
                    LoadNews();
                    break;
            }

            return true;
        }
开发者ID:ybs2011,项目名称:ADFC-NewsApp-Mono,代码行数:32,代码来源:News.cs

示例2: OnMenuItemSelected

        public override bool OnMenuItemSelected(int featureId, IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.ScanAction:
                    item.SetTitle(_scanner.IsScanning ? Resource.String.StartScan : Resource.String.StopScan);
                    if (_scanner.IsScanning)
                    {
                        _scanner.StopScan();
                        break;
                    }
                    _scanner.StartScan();
                    break;

                case Resource.Id.OpenServerAction:
                    item.SetTitle(_bluetoothServer.IsOpened ?  Resource.String.OpenServer : Resource.String.CloseServer);
                    if (_bluetoothServer.IsOpened)
                    {
                        _bluetoothServer.Close();
                    }
                    else
                    {
                        _bluetoothServer.Open();
                    }
                    break;
            }
            return true;
        }
开发者ID:jardar,项目名称:AndroidBluetoothLE,代码行数:28,代码来源:HomeScanView.cs

示例3: OnOptionsItemSelected

		public override bool OnOptionsItemSelected (IMenuItem item)
		{
			if (item.ItemId == Resource.Id.sample_action) {
				ToggleLogin ();
				item.SetTitle (mLoggedIn ? Resource.String.log_out : Resource.String.log_in);

				// Notify the system that the status of our roots has changed.  This will trigger
				// a call to MyCloudProvider.queryRoots() and force a refresh of the system
				// picker UI.  It's important to call this or stale results may persist.
				Activity.ContentResolver.NotifyChange (DocumentsContract.BuildRootsUri (AUTHORITY), null, false);
			}
			return true;
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:13,代码来源:MyCloudFragment.cs

示例4: OnOptionsItemSelected

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.toggle_orientation:
                    _orientation = (_orientation == Orientation.Horizontal)
                        ? Orientation.Vertical
                        : Orientation.Horizontal;
                    item.SetTitle((_orientation == Orientation.Horizontal)
                        ? Resource.String.vertical
                        : Resource.String.horizontal);
                    _foldingLayout.Orientation = _orientation;
                break;
            }

            return base.OnOptionsItemSelected(item);
        }
开发者ID:huguodong,项目名称:Foldinglayout,代码行数:17,代码来源:FoldingLayoutActivity.cs

示例5: OnOptionsItemSelected

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            //check if this is a plugin action
            if ((item.Intent != null) && (item.Intent.Action == Strings.ActionEntryActionSelected))
            {
                //yes. let the plugin handle the click:
                SendBroadcast(item.Intent);
                return true;
            }

            switch (item.ItemId)
            {
                case Resource.Id.menu_donate:
                    return Util.GotoDonateUrl(this);
                case Resource.Id.menu_toggle_pass:
                    if (_showPassword)
                    {
                        item.SetTitle(Resource.String.show_password);
                        _showPassword = false;
                    }
                    else
                    {
                        item.SetTitle(Resource.String.menu_hide_password);
                        _showPassword = true;
                    }
                    SetPasswordStyle();

                    return true;

                case Resource.Id.menu_lock:
                    App.Kp2a.LockDatabase();
                    return true;
                case Android.Resource.Id.Home:
                    //Currently the action bar only displays the home button when we come from a previous activity.
                    //So we can simply Finish. See this page for information on how to do this in more general (future?) cases:
                    //http://developer.android.com/training/implementing-navigation/ancestral.html
                    Finish();
                    OverridePendingTransition(Resource.Animation.anim_enter_back, Resource.Animation.anim_leave_back);

                    return true;
            }

            return base.OnOptionsItemSelected(item);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:44,代码来源:EntryActivity.cs

示例6: OnPrepareOptionsMenu

			public override bool OnPrepareOptionsMenu (IMenu menu)
			{
				connectMenu = menu.FindItem (Resource.Id.menuConnection);
				//settingsMenu = menu.FindItem (Resource.Id.menuSettings);
				menu.FindItem(Resource.Id.menuRefresh).SetVisible(false);
				menu.FindItem(Resource.Id.menuUpload).SetVisible(false);
				menu.FindItem(Resource.Id.menuFormat).SetVisible(false);
				
				
				if (BrickController.Instance.NXT.Connection.IsConnected) {
					connectMenu.SetTitle ("Disconnect");
				} 
				else {
					connectMenu.SetTitle ("Connect");
				}
				return base.OnPrepareOptionsMenu (menu);
				
			}
开发者ID:seipekm,项目名称:MonoBrick-Communication-Software,代码行数:18,代码来源:TabActivity.cs

示例7: OnCreateOptionsMenu

		public override bool OnCreateOptionsMenu(IMenu menu){
			//bool isRunning = IsTunnelServiceRunning();
			base.OnCreateOptionsMenu (menu);
			MenuInflater.Inflate(Resource.Layout.OptionMenu,menu);
			startButton = menu.FindItem(Resource.Id.option_start_stop);
			connectButton = menu.FindItem(Resource.Id.option_connect);;
			exitButton = menu.FindItem(Resource.Id.option_exit);

			connectButton.SetTitle("Connect To Client");
			connectButton.SetIcon(Resource.Drawable.addClient);

			exitButton.SetIcon(Resource.Drawable.exit);
			exitButton.SetTitle("Exit");
			return true;
		}
开发者ID:seipekm,项目名称:MonoBrick-Communication-Software,代码行数:15,代码来源:OptionMenu.cs

示例8: OnOptionsItemSelected

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            var title = item.TitleFormatted.ToString();
            switch (title)
            {
                case "Map View":
                    // set the title and icon
                    item
                        .SetTitle("List View")
                        .SetIcon(Resource.Drawable.list);

                    // load the map
                    LoadMap();

                    // set the list visibility
                    SetListVisibility(false);
                    break;
                case "List View":
                    // set the title and icon
                    item
                        .SetTitle("Map View")
                        .SetIcon(Resource.Drawable.map);

                    // set the list visibility
                    SetListVisibility(true);

                    // hide the map
                    HideMap();
                    break;
            }

            return base.OnOptionsItemSelected(item);
        }
开发者ID:RhysPartlett,项目名称:oakville-heritage-properties,代码行数:33,代码来源:MainActivity.cs


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