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


C# NSTableView.TableColumns方法代码示例

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


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

示例1: InitializeTable

 private void InitializeTable(NSTableView table)
 {
     var columns = table.TableColumns();
     columns[0].SetIdentifier(PreviewTableDelegate.CellIdentifiers[0]);
     columns[0].MinWidth = 50;
     columns[0].MaxWidth = 200;
     columns[0].Width = 60;
     var bc = new NSButtonCell();
     bc.SetButtonType(NSButtonType.OnOff);
  //   columns[0].DataCell = bc;
     columns[0].Title = Configuration.Settings.Language.General.Apply;
     columns[1].SetIdentifier(PreviewTableDelegate.CellIdentifiers[1]);
     columns[1].MinWidth = 50;
     columns[1].MaxWidth = 200;
     columns[1].Width = 60;
     columns[1].Title = Configuration.Settings.Language.General.LineNumber;
     table.AddColumn(new NSTableColumn(PreviewTableDelegate.CellIdentifiers[2]) 
         {
             MinWidth = 100,
             MaxWidth = 2000,
             Width = 250,
             Title = Configuration.Settings.Language.General.Before,
         });
     table.AddColumn(new NSTableColumn(PreviewTableDelegate.CellIdentifiers[3]) 
         {
             MinWidth = 100,
             MaxWidth = 2000,
             Width = 250,
             Title = Configuration.Settings.Language.General.After,
         });                             
 }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:31,代码来源:RemoveTextForHearingImpaired.cs

示例2: InitializeTable

 private void InitializeTable(NSTableView table)
 {
     var columns = table.TableColumns();
     columns[0].SetIdentifier(StringListTableDelegate.CellIdentifiers[0]);
     columns[0].MinWidth = 50;
     columns[0].MaxWidth = 20000;
     columns[0].Width = 2060;
 }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:8,代码来源:SpellCheck.cs

示例3: InitializeTable

        private void InitializeTable(NSTableView table)
        {
            var columns = table.TableColumns();
            columns[0].SetIdentifier(StringListTableDelegate.CellIdentifiers[0]);
            columns[0].MinWidth = 50;
            columns[0].MaxWidth = 20000;
            columns[0].Width = 2060;
            columns[0].Title = Configuration.Settings.Language.Interjections.Title;

            _interjections = GetInterjections();
            ShowInterjections(_interjections);
        }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:12,代码来源:EditInterjections.cs

示例4: InitializeTable

        private void InitializeTable(NSTableView table)
        {
            var columns = table.TableColumns();
            columns[0].SetIdentifier(AutoBackupTableDelegate.CellIdentifiers[0]);
            columns[0].MinWidth = 110;
            columns[0].MaxWidth = 200;
            columns[0].Width = 140;
            columns[0].Title = Configuration.Settings.Language.RestoreAutoBackup.DateAndTime;
            columns[1].SetIdentifier(AutoBackupTableDelegate.CellIdentifiers[1]);
            columns[1].MinWidth = 140;
            columns[1].MaxWidth = 10200;
            columns[1].Width = 260;
            columns[1].Title = Configuration.Settings.Language.RestoreAutoBackup.FileName;
            table.AddColumn(new NSTableColumn(AutoBackupTableDelegate.CellIdentifiers[2]) 
            {
                MinWidth = 50,
                MaxWidth = 200,
                Width = 70,
                Title = Configuration.Settings.Language.RestoreAutoBackup.Extension,
            });
            table.AddColumn(new NSTableColumn(AutoBackupTableDelegate.CellIdentifiers[3]) 
            {
                MinWidth = 60,
                MaxWidth = 150,
                Width = 90,
                Title = Configuration.Settings.Language.General.Size,
            });


            //2011-12-13_20-19-18_title
            if (Directory.Exists(Configuration.AutoBackupFolder))
            {
                var autoBackupItems = new List<AutoBackupItem>();
                var files = Directory.GetFiles(Configuration.AutoBackupFolder, "*.*");
                foreach (string fileName in files)
                {
                    if (fileNamePattern.IsMatch(Path.GetFileName(fileName)))
                    {
                        autoBackupItems.Add(new AutoBackupItem(fileName));
                    }
                }
                autoBackupItems = autoBackupItems.OrderBy(p => p.DisplayDate).ToList();
                var ds = new AutoBackupTableDataSource(autoBackupItems);
                table.DataSource = ds;
                table.Delegate = new AutoBackupTableDelegate(ds);
            }
        }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:47,代码来源:RestoreAutoBackup.cs

示例5: ReloadTableView

		public void ReloadTableView(NSTableView tableView, List<HttpTransportViewData> datasource, HttpTransportCollection collection)
		{
//			tableView.Delegate = new TableDelegate (this);
//			var listView = new HttpTransportDataSource { Entries = datasource };
//			tableView.DataSource = listView;
//			tableView.ReloadData ();

			foreach(NSTableColumn column in tableView.TableColumns())
			{
				tableView.RemoveColumn (column);
			}
			tableView.Delegate = new TableDelegate (this);
			var listView = new HttpTransportDataSource { Entries = datasource, HttpTransportCollection = collection };
			var columnNames = new List<ColumnOptions> {
				new ColumnOptions{ Id = "Method", DisplayName = "", DisplayOrder = 1, Width = 60, Type = ColumnType.Text },
				new ColumnOptions{ Id = "Name", DisplayName = "Name", DisplayOrder = 2, Width = 400, Type = ColumnType.Text }
			};
			var columns = ListViewHelper.ToNSTableColumns (columnNames);
			foreach (var column in columns) {
				tableView.AddColumn (column);
			}
			tableView.DataSource = listView;
			tableView.ReloadData ();
		}
开发者ID:saberlilydian,项目名称:lightwave,代码行数:24,代码来源:ShowHttpTransportController.cs

示例6: ReloadTableView

		private void ReloadTableView(NSTableView tableView, Dictionary<string,string> datasource)
		{
			foreach(NSTableColumn column in tableView.TableColumns())
			{
				tableView.RemoveColumn (column);
			}
			tableView.Delegate = new TableDelegate ();
			var columnNames = new List<ColumnOptions> {
				new ColumnOptions{ Id = "Name", DisplayName = "Name", DisplayOrder = 1, Width = 80 },
				new ColumnOptions{ Id = "Value", DisplayName = "Value", DisplayOrder = 2, Width = 200 }
			};
			var columns = ListViewHelper.ToNSTableColumns (columnNames);
			foreach (var column in columns) {
				tableView.AddColumn (column);
			}
			var listView = new DictionaryDataSource { Entries = datasource.Keys.ToList(), Datasource = datasource };
			tableView.DataSource = listView;
			tableView.ReloadData ();
		}
开发者ID:saberlilydian,项目名称:lightwave,代码行数:19,代码来源:ExtenalIdpDetailsViewController.cs

示例7: GetViewForItem

        public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            if(tableView.TableColumns()[0] != tableColumn)
                return null;

            NSTextField textField = (NSTextField)tableView.MakeView("myView", tableView);
            if (textField == null){
                textField = new NSTextField(tableView.VisibleRect());
                textField.Identifier = "myView";
            }
            textField.StringValue = names[row];
            return textField;
        }
开发者ID:perfp,项目名称:Chip8,代码行数:13,代码来源:MainWindowController.cs

示例8: InitializeSubtitleTable

 private void InitializeSubtitleTable(NSTableView table)
 {
     var columns = table.TableColumns();
     columns[0].SetIdentifier(SubtitleTableDelegate.CellIdentifiers[0]);
     columns[0].MinWidth = 20;
     columns[0].MaxWidth = 100;
     columns[0].Width = 40;
     columns[0].Title = Configuration.Settings.Language.General.LineNumber;
     columns[1].SetIdentifier(SubtitleTableDelegate.CellIdentifiers[1]);
     columns[1].MinWidth = 50;
     columns[1].MaxWidth = 200;
     columns[1].Width = 90;
     columns[1].Title = Configuration.Settings.Language.General.StartTime;
     table.AddColumn(new NSTableColumn(SubtitleTableDelegate.CellIdentifiers[2])
         {
             MinWidth = 50,
             MaxWidth = 200,
             Width = 90,
             Title = Configuration.Settings.Language.General.EndTime,
         });
     table.AddColumn(new NSTableColumn(SubtitleTableDelegate.CellIdentifiers[3])
         {
             MinWidth = 40,
             MaxWidth = 150,
             Width = 60,
             Title = Configuration.Settings.Language.General.Duration,
         });
     table.AddColumn(new NSTableColumn(SubtitleTableDelegate.CellIdentifiers[4])
         {
             MinWidth = 100,
             MaxWidth = 90000,
             Width = 1000,
             Title = Configuration.Settings.Language.General.Text,
         });
     ShowSubtitle();
 }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:36,代码来源:FixCommonErrors.cs

示例9: InitializeRulesTable

        private void InitializeRulesTable(NSTableView table)
        {
            var columns = table.TableColumns();
            columns[0].SetIdentifier(FixCommonErrorsTableDelegate.CellIdentifiers[0]);
            columns[0].MinWidth = 50;
            columns[0].MaxWidth = 200;
            columns[0].Width = 60;
            var bc = new NSButtonCell();
            bc.SetButtonType(NSButtonType.OnOff);
            columns[0].Title = Configuration.Settings.Language.MultipleReplace.Enabled;
            columns[1].SetIdentifier(FixCommonErrorsTableDelegate.CellIdentifiers[1]);
            columns[1].MinWidth = 100;
            columns[1].MaxWidth = 600;
            columns[1].Width = 250;
            columns[1].Title = Configuration.Settings.Language.MultipleReplace.FindWhat;
            table.AddColumn(new NSTableColumn(FixCommonErrorsTableDelegate.CellIdentifiers[2])
                {
                    MinWidth = 100,
                    MaxWidth = 2000,
                    Width = 250,
                    Title = Configuration.Settings.Language.MultipleReplace.ReplaceWith,
                });

            _fixActions = InitializeRules();
            ShowFixRules();
        }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:26,代码来源:FixCommonErrors.cs

示例10: InitializeRulesTable

        private void InitializeRulesTable(NSTableView table)
        {
            var columns = table.TableColumns();
            columns[0].SetIdentifier(MultipleRulesTableDelegate.CellIdentifiers[0]);
            columns[0].MinWidth = 50;
            columns[0].MaxWidth = 200;
            columns[0].Width = 60;
            var bc = new NSButtonCell();
            bc.SetButtonType(NSButtonType.OnOff);
            columns[0].Title = Configuration.Settings.Language.MultipleReplace.Enabled;
            columns[1].SetIdentifier(MultipleRulesTableDelegate.CellIdentifiers[1]);
            columns[1].MinWidth = 100;
            columns[1].MaxWidth = 600;
            columns[1].Width = 250;
            columns[1].Title = Configuration.Settings.Language.MultipleReplace.FindWhat;
            table.AddColumn(new NSTableColumn(MultipleRulesTableDelegate.CellIdentifiers[2])
                {
                    MinWidth = 100,
                    MaxWidth = 2000,
                    Width = 250,
                    Title = Configuration.Settings.Language.MultipleReplace.ReplaceWith,
                });
            table.AddColumn(new NSTableColumn(MultipleRulesTableDelegate.CellIdentifiers[3])
                {
                    MinWidth = 100,
                    MaxWidth = 2000,
                    Width = 250,
                    Title = Configuration.Settings.Language.MultipleReplace.SearchType,
                });       
            
            _rulesContextMenuDelete.Activated += (object sender, EventArgs e) =>
            {
                var index = (int)_rulesTable.SelectedRow;
                if (index >= 0 && index < MultipleSearchAndReplaceList.Count)
                {
                    MultipleSearchAndReplaceList.RemoveAt(index);
                    ShowRules(MultipleSearchAndReplaceList);
                    if (index >= MultipleSearchAndReplaceList.Count)
                    {
                        index--;
                    }
                    if (index >= 0)
                    {
                        _rulesTable.SelectRow((nint)index, false);
                    }
                }
            };

            _rulesContextMenuMoveUp.Activated += (object sender, EventArgs e) =>
            {
                var index = (int)_rulesTable.SelectedRow;
                if (index > 0 && index < MultipleSearchAndReplaceList.Count)
                {
                    var item = MultipleSearchAndReplaceList[index];
                    MultipleSearchAndReplaceList.RemoveAt(index);
                    MultipleSearchAndReplaceList.Insert(index - 1, item);
                    ShowRules(MultipleSearchAndReplaceList);
                    _rulesTable.SelectRow((nint)index - 1, false);
                }
            };

            _rulesContextMenuMoveDown.Activated += (object sender, EventArgs e) =>
            {
                var index = (int)_rulesTable.SelectedRow;
                if (index >= 0 && index < MultipleSearchAndReplaceList.Count - 1)
                {
                    var item = MultipleSearchAndReplaceList[index];
                    MultipleSearchAndReplaceList.RemoveAt(index);
                    MultipleSearchAndReplaceList.Insert(index + 1, item);
                    ShowRules(MultipleSearchAndReplaceList);
                    _rulesTable.SelectRow((nint)index + 1, false);
                }
            };
        }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:74,代码来源:MultipleReplace.cs


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