[Mono-osx] Suggestions for standard naming of "numberOf..." methods

Regan Sarwas rsarwas at gmail.com
Sat Jan 1 18:14:53 EST 2011


Below is the summary from the MonoMac API.  My suggestions appear as
comments.  In my opinion XxxCount was clearest in most cases.  I did not
propose changes to the members of any of the [Model] classes, or
NSBrowserDelegate, as I am not sure of the implications or what reads best.
 Make (or reject) any changes you want and I will implement.

=========
Appkit.cs
=========
interface NSBitmapImageRep {
[Export ("numberOfPlanes")]
int Planes { get; }
// use PlaneCount
--
interface NSBrowser {
[Export ("numberOfVisibleColumns")]
int VisibleColumns { get; }
// use VisibleColumnCount
--
interface NSBrowserDelegate {
[Export ("browser:numberOfRowsInColumn:"), EventArgs ("NSBrowserColumn")]
int RowsInColumn (NSBrowser sender, int column);
 [Export ("browser:numberOfChildrenOfItem:")]
int CountChildren (NSBrowser browser, NSObject item);
--
interface NSColor {
[Export ("numberOfComponents")]
int ComponentCount { get; }
--
interface NSColorSpace {
[Export ("numberOfColorComponents")]
int ColorComponents { get; }
// use ComponentCount
--
interface NSComboBox {
[Export ("numberOfVisibleItems")]
int VisibleItems { get; set; }
// use VisibleItemCount

[Export ("numberOfItems")]
int Count { get; }
// use ItemCount
--
[Model]
interface NSComboBoxDataSource {
[Export ("numberOfItemsInComboBox:")]
int ItemCount (NSComboBox comboBox);
--
interface NSFont {
[Export ("numberOfGlyphs")]
int GlyphCount { get; }
--
interface NSGradient {
[Export ("numberOfColorStops")]
int ColorStopsCount { get; }
// use ColorStopCount
--
interface NSMenu {
[Export ("numberOfItems")]
int Count { get; }
--
[Model]
interface NSMenuDelegate {
[Export ("numberOfItemsInMenu:")]
int MenuItemCount (NSMenu menu);
--
interface NSOpenGLPixelFormat {
[Export ("numberOfVirtualScreens")]
int NumberOfVirtualScreens { get; }
//use VirtualScreenCount
--
[Model]
interface NSOutlineViewDataSource {
[Export ("outlineView:numberOfChildrenOfItem:")]
int GetChildrenCount (NSOutlineView outlineView, NSObject item);
--
interface NSMatrix {
[Export ("numberOfRows")]
int Rows { get; }
// use RowCount

[Export ("numberOfColumns")]
int Columns { get; }
// use ColumnCount
--
interface NSLevelIndicator {
[Export ("numberOfTickMarks")]
int TickMarkCount { get; set; }

[Export ("numberOfMajorTickMarks")]
int MajorTickMarkCount { get; set; }
--
interface NSLevelIndicatorCell {
[Export ("numberOfTickMarks")]
int TickMarkCount { get; set; }

[Export ("numberOfMajorTickMarks")]
int MajorTickMarkCount { get; set; }
--
interface NSPopUpButton {
[Export ("numberOfItems")]
int ItemCount { get; }
--
interface NSPopUpButtonCell {
[Export ("numberOfItems")]
int Count { get; }
// use ItemCount
--
interface NSSlider {
[Export ("numberOfTickMarks")]
int TickMarksCount { get; set; }
// use TickMarkCount
--
interface NSSliderCell {
[Export ("numberOfTickMarks")]
int TickMarks { get; set; }
// use TickMarkCount
--
interface NSTableView {
[Export ("numberOfColumns")]
int ColumnCount { get; }

[Export ("numberOfRows")]
int RowCount { get; }
--
[Export ("numberOfSelectedColumns")]
int SelectedColumnsCount { get; }
// use SelectedColumnCount
--
[Export ("numberOfSelectedRows")]
int SelectedRowCount { get; }
--
[Model]
interface NSTableViewDataSource {
[Export ("numberOfRowsInTableView:")]
int GetRowCount (NSTableView tableView);
--
[Model]
interface NSTableViewSource {
[Export ("numberOfRowsInTableView:")]
int GetRowCount (NSTableView tableView);
--
interface NSTabView {
[Export ("numberOfTabViewItems")]
int Count { get; }
// use TabViewItemCount
--
interface NSTextTable {
[Export ("numberOfColumns")]
int Columns { get; set; }
// use ColumnCount
--
interface NSRuleEditor {
         [Export ("numberOfRows")]
         int NumberOfRows { get; }
// use RowCount
--
[Model]
   interface NSRuleEditorDelegate {
         [Export ("ruleEditor:numberOfChildrenForCriterion:withRowType:"),
DelegateName ("NSRuleEditorNumberOfChildren"), DefaultValue(0)]
         int NumberOfChildren (NSRuleEditor editor, NSObject criterion,
NSRuleEditorRowType rowType);

============
coreimage.cs
============
    interface CIColor { [Export ("numberOfComponents")]
int NumberOfComponents { get; }
//use ComponentCount
==================
nslayoutmanager.cs
==================
    interface NSLayoutManager { [Export ("numberOfGlyphs")]
int NumberOfGlyphs { get; }
//use GlyphCount
============
src/qtkit.cs
============
    interface QTSampleBuffer {
[Export ("numberOfSamples")]
int SampleCount { get; }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110101/2da16216/attachment-0001.html 


More information about the Mono-osx mailing list