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


C# MonoTouch类代码示例

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


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

示例1: GetCell

			public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
			{
				var section = root.Sections [indexPath.Section];
				var element = section.Elements [indexPath.Row];
				
				return element.GetCell (tableView);
			}
开发者ID:mikebluestein,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:DialogViewController.cs

示例2: TouchesCancelled

 /// <summary>
 /// Called when the touches are cancelled due to a phone call, etc.
 /// </summary>
 public override void TouchesCancelled(MonoTouch.Foundation.NSSet touches, UIEvent evt)
 {
     base.TouchesCancelled (touches, evt);
     // we fail the recognizer so that there isn't unexpected behavior
     // if the application comes back into view
     base.State = UIGestureRecognizerState.Failed;
 }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:10,代码来源:CheckmarkGestureRecognizer.cs

示例3: GetCellImpl

        protected override MonoTouch.UIKit.UITableViewCell GetCellImpl(MonoTouch.UIKit.UITableView tv)
        {
            //Implement binding of Title property in the business object to Caption propery of String Element
            this.Bind(MvxBindingTouchView, DataContext, "{'Caption':{'Path':'Title'}}");

            return base.GetCellImpl(tv);
        }
开发者ID:asednev,项目名称:MvvmCross.AlexeysExtensions,代码行数:7,代码来源:SampleStringElement.cs

示例4: TDBadgedCell

        /// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        /*
         * public override UITableViewCell GetCell
           (UITableView tableView, NSIndexPath indexPath)
        {
           TDBadgedCell cell = new TDBadgedCell (UITableViewCellStyle.Subtitle, "Cell");
           cell.TextLabel.Text = contents[indexPath.Row].Title;
           cell.TextLabel.Font = UIFont.BoldSystemFontOfSize (14);

           cell.DetailTextLabel.Text = contents[indexPath.Row].Detail;
           cell.DetailTextLabel.Font = UIFont.SystemFontOfSize (13);

           cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
           cell.BadgeNumber = Convert.ToInt32 (contents[indexPath.Row].Badge);

           if (indexPath.Row == 1)
          cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.397f, 0.419f, 1.000f);
           if (indexPath.Row == 2)
          cell.BadgeColor = UIColor.FromWhiteAlpha (0.783f, 1.000f);
           return cell;
        }
         */
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            Console.WriteLine ("Calling Get Cell, isEditing:" + tableView.Editing);

            //---- declare vars
            TDBadgedCell cell = (TDBadgedCell)tableView.DequeueReusableCell (cellIdentifier);

            //---- if there are no cells to reuse, create a new one
            if (cell == null)
                cell = new TDBadgedCell (UITableViewCellStyle.Subtitle, cellIdentifier);

            //---- set the item text
            cell.TextLabel.Text = tableItems [indexPath.Section].Items [indexPath.Row].activityType.activityTypeName;
            DateTime dd = Tools.ConvertJavaMiliSecondToDateTime (tableItems [indexPath.Section].Items [indexPath.Row].lastDate);

            if (tableItems [indexPath.Section].Items [indexPath.Row].lastDate > 0) {
                cell.DetailTextLabel.Text = dd.ToLongDateString () + " - " + dd.ToShortTimeString();
                cell.DetailTextLabel.Font = UIFont.SystemFontOfSize (11);
                cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton;

            }
            UIImage img = UIImage.FromFile ("Images/258-checkmark.png");
            cell.ImageView.Image = img;
            cell.BadgeNumber = Convert.ToInt32 (tableItems [indexPath.Section].Items [indexPath.Row].total);

            if (indexPath.Row == 1)
                cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.397f, 0.419f, 1.000f);
            if (indexPath.Row == 2)
                cell.BadgeColor = UIColor.FromWhiteAlpha (0.783f, 1.000f);
            if (indexPath.Row == 3)
                cell.BadgeColor = UIColor.FromRGBA (1.000f, 0.333f, 0.666f, 1.000f);

            return cell;
        }
开发者ID:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:58,代码来源:TableSource.cs

示例5: GetCell

            public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
            {
                if (indexPath.Section < _viewModel.UpcomingSlots.Count)
                {
                    var cell = tableView.DequeueReusableCell(OVERVIEW_SCHEDULE_CELL)
                                ?? new UITableViewCell(UITableViewCellStyle.Subtitle, OVERVIEW_SCHEDULE_CELL);
                    var session = _viewModel.UpcomingSlots[indexPath.Section].Sessions[indexPath.Row];

                    cell.TextLabel.Text = session.Title;

                    if (string.IsNullOrEmpty(session.Speaker.Name))
                        cell.DetailTextLabel.Text = "Room: " + session.Room;
                    else
                        cell.DetailTextLabel.Text = string.Format("Room: {0}, {1}", session.Room, session.Speaker.Name);

                    cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;

                    return cell;
                }
                else
                {
                    var cell = tableView.DequeueReusableCell(OVERVIEW_LINK_CELL)
                                ?? new UITableViewCell(UITableViewCellStyle.Default, OVERVIEW_LINK_CELL);

                    cell.TextLabel.Text = "Full Schedule";
                    cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;

                    return cell;
                }
            }
开发者ID:jorik041,项目名称:NycCodeCamp6,代码行数:30,代码来源:CampOverviewViewController.cs

示例6: GetCell

        public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            var item = this.Data[indexPath.Row] as Stock;

            if (item == null)
            {
                return base.GetCell (tableView, indexPath);
            }

            var cellProvider = tableView as ITableCellProvider;

            if (cellProvider != null)
            {
                return cellProvider.GetCell (item);
            }

            var cell = tableView.DequeueReusableCell(StockCell.Key) as StockCell;

            if (cell == null)
            {
                cell = StockCell.Create();
                //var views = NSBundle.MainBundle.LoadNib("StockTableCell", cell, null);
                //cell = Runtime.GetNSObject( views.ValueAt(0) ) as StockTableCell;
            }

            cell.Bind (item);

            return cell;
        }
开发者ID:paul33868,项目名称:SimplyMobile,代码行数:29,代码来源:StockDataAdapter.cs

示例7: GetCell

		/// <summary>
		/// Called by the TableView to get the actual UITableViewCell to render for the particular row
		/// </summary>
		public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
		{
			// request a recycled cell to save memory
			UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);

			// UNCOMMENT one of these to use that style
			var cellStyle = UITableViewCellStyle.Default;
//			var cellStyle = UITableViewCellStyle.Subtitle;
//			var cellStyle = UITableViewCellStyle.Value1;
//			var cellStyle = UITableViewCellStyle.Value2;

			// if there are no cells to reuse, create a new one
			if (cell == null) {
				cell = new UITableViewCell (cellStyle, cellIdentifier);
			}

			cell.TextLabel.Text = tableItems[indexPath.Row].Heading;
			
			// Default style doesn't support Subtitle
			if (cellStyle == UITableViewCellStyle.Subtitle 
			   || cellStyle == UITableViewCellStyle.Value1
			   || cellStyle == UITableViewCellStyle.Value2) {
				cell.DetailTextLabel.Text = tableItems[indexPath.Row].SubHeading;
			}
			
			// Value2 style doesn't support an image
			if (cellStyle != UITableViewCellStyle.Value2)
				cell.ImageView.Image = UIImage.FromFile ("Images/" +tableItems[indexPath.Row].ImageName);
			
			return cell;
		}
开发者ID:kiwchang,项目名称:Storyboard.Tabbar.EmbeddedTableview,代码行数:34,代码来源:TableSource.cs

示例8: showWindow

partial         void showWindow(MonoTouch.Foundation.NSObject sender)
        {
            hud = BindingLibrarySDK.MBProgressHUD.ShowHUDAddedTo(this.View, true);
            hud.Show(true);
            hud.LabelText = "加载中...";
            hud.Hide(true, 1); // hide hud after 1s
        }
开发者ID:sunleepy,项目名称:monotouch_binding,代码行数:7,代码来源:BindingLibrarySampleViewController.cs

示例9: GetCell

        public MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            if (VM.CanLoadMore && !VM.IsBusy && (indexPath.Row == VM.Members.Count - 1))
                VM.LoadMoreCommand.Execute (null);

            return MainTableView.Source.GetCell (tableView, indexPath);
        }
开发者ID:rferolino,项目名称:MeetupManager,代码行数:7,代码来源:EventView.designer.cs

示例10: TitleForHeader

		public string TitleForHeader (MonoTouch.UIKit.UITableView tableView, int section)
		{
			if (section == 1)
				return "Right Drawer Width";
			else
				return base.TitleForHeader (tableView, section);
		}
开发者ID:adlair,项目名称:MMDrawerController,代码行数:7,代码来源:MMExampleRightSideDrawerViewController.cs

示例11: GetCell

 public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv)
 {
     var cell = base.GetCell (tv);
     cell.TextLabel.Font = AppDelegate.Font;
     cell.TextLabel.TextColor = UIColor.Black;
     return cell;
 }
开发者ID:AlexanderMazaletskiy,项目名称:DietCalculatorUniversal,代码行数:7,代码来源:DietRadioElement.cs

示例12: GetCell

        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            ShopsTableCell cell = new ShopsTableCell(cellIdentifier);
            try
            {
                cell = tableView.DequeueReusableCell(cellIdentifier) as ShopsTableCell;

                if (cell == null)
                    cell = new ShopsTableCell(cellIdentifier);
                if (!String.IsNullOrEmpty(tableItems[indexPath.Row].FirstPhotoUrl))
                {
                    NSUrl nsUrl = new NSUrl(tableItems[indexPath.Row].FirstPhotoUrl);
                    NSData data = NSData.FromUrl(nsUrl);

                    if (data != null)
                        cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage(data));
                    else
                        cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage());
                }
                else
                    cell.UpdateCell(tableItems[indexPath.Row].Name, tableItems[indexPath.Row].Description, tableItems[indexPath.Row].Price.ToString("N2"), new UIImage());

                OnGotCell();
                CellOn = indexPath.Row;
            }
            catch (Exception exception)
            {
                ErrorHandler.Save(exception, MobileTypeEnum.iPhone);
            }
            return cell;
        }
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:31,代码来源:ShopsTableView.cs

示例13: GetCell

		/// <summary>
		/// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
		/// </summary>
		public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
		{
			//---- declare vars
			UITableViewCell cell = tableView.DequeueReusableCell (this._customCellIdentifier);
			CustomTableViewCell customCellController = null;
			
			//---- if there are no cells to reuse, create a new one
			if (cell == null)
			{
				customCellController = new CustomTableViewCell ();
				// retreive the cell from our custom cell controller
				cell = customCellController.Cell;
				// give the cell a unique ID, so we can match it up to the controller
				cell.Tag = Environment.TickCount;
				// store our controller with the unique ID we gave our cell
				this._cellControllers.Add (cell.Tag, customCellController);
			}
			else
			{
				// retreive our controller via it's unique ID
				customCellController = this._cellControllers[cell.Tag];
			}
			
			//---- create a shortcut to our item
			TagesgerichtBasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];
			
			//---- set our cell properties
			customCellController.Heading = item.Name;
			customCellController.SubHeading = item.SubHeading;
			customCellController.Speisentext = item.Speisentext;
			
			//---- return the custom cell
			return cell;
		}
开发者ID:bpug,项目名称:LbkIos,代码行数:37,代码来源:TagesgerichtCustomTableViewSource.cs

示例14: RowSelected

			public override void RowSelected (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
			{
				var section = root.Sections [indexPath.Section];
				var element = section.Elements [indexPath.Row];

				element.Selected (container, tableView, indexPath);
			}
开发者ID:mikebluestein,项目名称:MonoTouch.Dialog,代码行数:7,代码来源:DialogViewController.cs

示例15: GetCell

		public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
		{
			UITableViewCell cell = tableView.DequeueReusableCell(kTableViewCellIdentifier, indexPath);
			cell.TextLabel.Text = _visibleResults[indexPath.Row];

			return cell;
		}
开发者ID:Luceres,项目名称:monotouch-samples,代码行数:7,代码来源:SearchControllerBaseViewController.cs


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