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


C# AppKit.NSTableView类代码示例

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


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

示例1: GetObjectValue

        public override NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            NSTableColumn[] cols = tableView.TableColumns();
            int idx = cols.ToList().FindIndex(t => t.HeaderCell.StringValue == tableColumn.HeaderCell.StringValue);

            switch(idx)
            {
                case (int)TableLocation.AV:
                    return new NSString(Rows[row][idx].ToString());
                case (int)TableLocation.TV:
                    return new NSString(Rows[row][idx].ToString());
                case (int)TableLocation.ISO:
                    return new NSString(Rows[row][idx].ToString());
                case (int)TableLocation.Keyframe:
                    return NSObject.FromObject(((bool)(Rows[row][idx])) ? NSCellStateValue.On : NSCellStateValue.Off);
                case (int)TableLocation.Filename:
                    return new NSString(Rows[row][idx].ToString());
                case (int)TableLocation.Nr:
                    return new NSString(Rows[row][idx].ToString());
                case (int)TableLocation.Brightness:
                    return new NSString(Rows[row][idx].ToString());

                default:
                    return new NSString("N/A");
            }
        }
开发者ID:ivynetca,项目名称:lapsestudio,代码行数:26,代码来源:HelperClasses.cs

示例2: GetObjectValue

        public override NSObject GetObjectValue(NSTableView tableView, 
		                                         NSTableColumn tableColumn, 
		                                         int row)
        {
            ServerInfo s = Items [row];

            if (tableColumn.Identifier == "List") {
                if(s.UserList == ServerInfo.UserListType.WhiteList)
                    return NSImage.ImageNamed("blacklist_0.png");
                else if(s.UserList == ServerInfo.UserListType.BlackList)
                    return NSImage.ImageNamed("blacklist_1.png");
                else
                    return NSImage.ImageNamed("blacklist_2.png");
            } else if (tableColumn.Identifier == "Flag") {
                return NSImage.ImageNamed("flag_" + s.CountryCode.ToLowerInvariant() + ".png");
            } else if (tableColumn.Identifier == "Name") {
                return new NSString (s.GetNameForList ());
            } else if (tableColumn.Identifier == "Score") {
                int p = Convert.ToInt32(5 * s.ScorePerc());
                return NSImage.ImageNamed ("stars_" + p.ToString() + ".png");
            } else if (tableColumn.Identifier == "Location") {
                return new NSString (s.GetLocationForList());
            } else if (tableColumn.Identifier == "Latency") {
                return new NSString (s.GetLatencyForList());
            } else if (tableColumn.Identifier == "LoadIcon") {
                return NSImage.ImageNamed("status_" + s.GetLoadColorForList().ToLowerInvariant() + ".png");
            } else if (tableColumn.Identifier == "Load") {
                return new NSString (s.GetLoadForList());
            } else if (tableColumn.Identifier == "Users") {
                return new NSString (s.GetUsersForList());
            } else
                throw new NotImplementedException (string.Format ("{0} is not recognized", tableColumn.Identifier));
        }
开发者ID:Clodo76,项目名称:airvpn-client,代码行数:33,代码来源:TableServersController.cs

示例3: GetObjectValue

        public override NSObject GetObjectValue(NSTableView table, NSTableColumn col, int row)
        {
            int column;

            // Determine which column is being selected
            switch (col.HeaderCell.Title) {
            case "Count":
                column = 0;
                break;
            case "Number":
                column = 1;
                break;
            case "Distance":
                column = 2;
                break;
            case "Interval":
                column = 3;
                break;
            case "Stroke":
                column = 4;
                break;
            case "Comment":
                column = 5;
                break;
            default:
                break;
            }
            if (row + 1 > m_tableData [column].Count)
                return new NSString ("");
            else
                return new NSString (m_tableData [column] [row]);
        }
开发者ID:photo-bro,项目名称:AquaTempus,代码行数:32,代码来源:TableViewHandler.cs

示例4: TableAreasController

		public TableAreasController (NSTableView tableView)
		{
			this.tableView = tableView;

			this.tableView.DataSource = this;

		}
开发者ID:liftir,项目名称:airvpn-client,代码行数:7,代码来源:TableAreasController.cs

示例5: GetObjectValue

        public override NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            //			var valueKey = (string)(NSString)tableColumn.Identifier;
            //			var dataRow = _profiles[row];

            return null;
        }
开发者ID:joemcbride,项目名称:outlander,代码行数:7,代码来源:ProfileSelectorController.cs

示例6: TableRoutingController

		public TableRoutingController (NSTableView tableView)
		{
			this.tableView = tableView;

			this.tableView.DataSource = this;

		}
开发者ID:liftir,项目名称:airvpn-client,代码行数:7,代码来源:TableRoutingController.cs

示例7: GetViewForItem

		public override NSView GetViewForItem (NSTableView tableView, NSTableColumn tableColumn, int row)
		{
			var view = (NSTableCellView)tableView.MakeView (tableColumn.Identifier, this);

			string value = string.Empty;
			switch (tableColumn.HeaderCell.Title) {

			case "Added":
				value = _notes [row].Added.ToShortDateString();
				break;

			case "Author":
				value = _notes [row].Author;
				break;

			case "Note":
				value = _notes [row].Content;
				break;

			default:
				break;
			}

			view.TextField.StringValue = value;
			return view;
		}
开发者ID:rexebin,项目名称:UnicornStore,代码行数:26,代码来源:NoteViewSource.cs

示例8: CreateCell

		public static NSCell CreateCell (ApplicationContext context, NSTableView table, ICellSource source, ICollection<CellView> cells, int column)
		{
			CompositeCell c = new CompositeCell (context, Orientation.Horizontal, source);
			foreach (var cell in cells)
				c.AddCell ((ICellRenderer) CreateCell (table, c, cell, column));
			return c;
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:7,代码来源:CellUtil.cs

示例9: SetObjectValue

			public override void SetObjectValue (NSTableView tableView, NSObject theObject, NSTableColumn tableColumn, int row)
			{
				NSString newNSValue = theObject as NSString;
				if (newNSValue == null)
					return;
				string newValue = newNSValue.ToString ();
				int columnIndex = tableView.FindColumn ((NSString)tableColumn.Identifier);
				BookmarkManager.Entry entry = entries[row];
				switch (columnIndex) {
				case 0:
					if (!string.IsNullOrWhiteSpace (newValue))
						entry.Name = newValue;
					break;
				case 1:
					entry.Notes = newValue;
					break;
				case 2:
					if (!string.IsNullOrWhiteSpace (newValue))
						entry.Url = newValue;
					break;
				default:
					break;
				}
				manager.CommitBookmarkChange (entry);
			}
开发者ID:roblillack,项目名称:monomac,代码行数:25,代码来源:BookmarkAssistantController.cs

示例10: GetObjectValue

        public override NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            if (row != -1)
                return (NSString)Program.Instance.StreamDeskCoreInstance.SettingsInstance.ActiveDatabases[row];

            return null;
        }
开发者ID:nagyist,项目名称:StreamDesk,代码行数:7,代码来源:ManageDatabasesController.cs

示例11: numberOfRowsInTableView

 public int numberOfRowsInTableView(NSTableView table_view)
 {
     if (Items == null)
         return 0;
     else
         return Items.Count;
 }
开发者ID:monreal,项目名称:SparkleShare,代码行数:7,代码来源:SparkleSetup.cs

示例12: TableTabsDelegate

        public TableTabsDelegate(NSTableView tableView, NSTabView tabView)
        {
            m_tableView = tableView;
            m_tabView = tabView;

            SelectionChange ();
        }
开发者ID:Clodo76,项目名称:airvpn-client,代码行数:7,代码来源:TableTabsDelegate.cs

示例13: GetObjectValue

        public override NSObject GetObjectValue(NSTableView tableView, 
		                                         NSTableColumn tableColumn, 
		                                         int row)
        {
            AreaInfo a = Items[row];

            if (tableColumn.Identifier == "List") {
                if(a.UserList == AreaInfo.UserListType.WhiteList)
                    return NSImage.ImageNamed("blacklist_0.png");
                else if(a.UserList == AreaInfo.UserListType.BlackList)
                    return NSImage.ImageNamed("blacklist_1.png");
                else
                    return NSImage.ImageNamed("blacklist_2.png");
            } else if (tableColumn.Identifier == "Flag") {
                return NSImage.ImageNamed("flag_" + a.Code.ToLowerInvariant() + ".png");
            } else if (tableColumn.Identifier == "Name") {
                return new NSString (a.Name);
            } else if (tableColumn.Identifier == "Servers") {
                return new NSString (a.Servers.ToString());
            } else if (tableColumn.Identifier == "LoadIcon") {
                return NSImage.ImageNamed("status_" + a.GetLoadColorForList().ToLowerInvariant() + ".png");
            } else if (tableColumn.Identifier == "Load") {
                return new NSString (a.GetLoadForList());
            } else if (tableColumn.Identifier == "Users") {
                return new NSString (a.Users.ToString());
            } else
                throw new NotImplementedException (string.Format ("{0} is not recognized", tableColumn.Identifier));
        }
开发者ID:Clodo76,项目名称:airvpn-client,代码行数:28,代码来源:TableAreasController.cs

示例14: GetObjectValue

		public override NSObject GetObjectValue (NSTableView tableView, 
		                                         NSTableColumn tableColumn, 
		                                         int row)
		{
			TableAdvancedEventsControllerItem i = Items [row];

			if (tableColumn.Identifier == "Event") {
				return new NSString (i.Title);
			}
			else if (tableColumn.Identifier == "FileName") {
				return new NSString (i.Filename);
			}
			else if (tableColumn.Identifier == "Arguments") {
				return new NSString (i.Arguments);
			}
			else if (tableColumn.Identifier == "WaitEnd") {
				if ((i.Filename.Trim () != "") || (i.Arguments.Trim () != "")) {
					if (i.WaitEnd)
						return NSImage.ImageNamed ("status_green_16.png");
					else
						return NSImage.ImageNamed ("status_red_16.png");
				} else
					return NSImage.ImageNamed ("status_unknown.png");
			}

			else 
				throw new NotImplementedException (string.Format ("{0} is not recognized", tableColumn.Identifier));
		}
开发者ID:liftir,项目名称:airvpn-client,代码行数:28,代码来源:TableAdvancedEventsController.cs

示例15: GetViewForItem

		public override NSView GetViewForItem (NSTableView tableView, NSTableColumn tableColumn, int row)
		{
			var product = WebService.Shared.CurrentOrder.Products [row];
			ShoppingBasketTableViewCellController controller = new ShoppingBasketTableViewCellController ();
			controller.Product = product;
			return (ShoppingBasketTableViewCell)controller.View;
		}
开发者ID:robertmiles3,项目名称:xamarin-store-app,代码行数:7,代码来源:ShoppingBasketTableViewSource.cs


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