Esempio n. 1
0
		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;
		}
		NSView GetOrCreateViewFor (NSTableView tableView, NSTableColumn tableColumn)
		{
			var view = tableView.MakeView (tableColumn.Identifier, this);
			var bindableColumn = tableColumn as MvxTableColumn;
			if (bindableColumn != null){
				if (view == null)
					view = new MvxTableCellView (bindableColumn.BindingText);
				else {
					IMvxBindingContextOwner bindableView = view as IMvxBindingContextOwner;
					bindableView.CreateBindingContext (bindableColumn.BindingText);
				}
			}
			return view;
		}
			public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row) {
				TransactionTableCellView tableCellView;

				switch(tableColumn.Identifier) {
				case "transactions":
					Transaction.Delta delta = Data.TransactionDeltas[row];

					tableCellView = (TransactionTableCellView)tableView.MakeView("transaction", this);
//					tableCellView.Value = String.Format("{0}{1}", delta.Value > Money.Zero("BTC") ? "+" : "", delta.Value);
//					tableCellView.Hash = delta.Transaction.Hash;
					tableCellView.Delta = delta;

					break;

				default:
					throw new NotImplementedException();
				}

				return tableCellView;
			}
		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 "Job#":
				value = _orders [row].WorkOrderId.ToString().PadLeft(10, '0');
				break;

			case "Title":
				value = _orders [row].Title;
				break;

			default:
				break;
			}

			view.TextField.StringValue = value;
			return view;
		}
            public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
            {
                if (NSObject.Equals (tableColumn.Identifier, MainWindowController._idImageColumn))
                {
                    NSImageView imageView = tableView.MakeView ("GlyphView", this) as NSImageView;
                    if (imageView == null) {
                        imageView = new XImageView ();
                        SetIdentifierToView (imageView, "GlyphView");
                    }
                    var img = new NSImage (glyphInfos[row].GlyphImage, new SizeF (rowHeight-2f, rowHeight-2f));
                    imageView.Image = img;
                    return imageView;
                }
                else if (NSObject.Equals (tableColumn.Identifier, MainWindowController._idNameColumn))
                {
                    NSTextField textfield = tableView.MakeView ("NameView", this) as NSTextField;
                    if (textfield == null) {
                        textfield = new NSTextField ();
                        //textfield.BackgroundColor = NSColor.DarkGray;
                        textfield.BackgroundColor = NSColor.FromDeviceWhite (0f, 0.5f);
                        textfield.Bordered = false;
                        SetIdentifierToView (textfield, "NameView");
                        //textfield.Alignment = NSTextAlignment.Center;
                        textfield.Cell = new XTextFieldCell (textfield);
                    }

                    textfield.StringValue = glyphInfos[row].GlyphName;

                    return textfield;
                }
                else if (NSObject.Equals (tableColumn.Identifier, MainWindowController._idDetailColumn))
                {

                    NSTextField textfield = tableView.MakeView ("DetailView", this) as NSTextField;
                    if (textfield == null) {
                        textfield = new NSTextField ();
                        //textfield.BackgroundColor = NSColor.DarkGray;
                        textfield.BackgroundColor = NSColor.FromDeviceWhite (0f, 0.5f);
                        textfield.Bordered = false;
                        SetIdentifierToView (textfield, "DetailView");

                        textfield.Cell = new XTextFieldCell (textfield);
                    }

                    textfield.StringValue = String.Format ("\"{0}\" 0x{1:x}", glyphInfos[row].RawName, glyphInfos[row].GlyphId);

                    return textfield;
                }
                return null;
            }
 public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
 {
     var view = (NSTableCellView)tableView.MakeView("cellFolderPath", this);
     view.TextField.Font = NSFont.FromFontName("Roboto", 11);
     view.TextField.StringValue = _libraryAppConfig.Folders[row].FolderPath;
     return view;
 }
Esempio n. 7
0
        public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            NSTableCellView view;
            if(tableColumn.Identifier.ToString() == "columnDeviceName")
            {
                view = (NSTableCellView)tableView.MakeView("cellDeviceName", this);
                view.TextField.StringValue = _items[row].Name;
            }
            else
            {
                view = (NSTableCellView)tableView.MakeView("cellDeviceDescription", this);
                view.TextField.StringValue = _items[row].IsOnline ? "Online" : "Offline";
            }

            if (view.ImageView != null)
            {
                string iconName = string.Empty;
                switch (_items[row].DeviceType)
                {
                    case SyncDeviceType.Linux:
                        iconName = "pc_linux";
                        break;
                    case SyncDeviceType.OSX:
                        iconName = "pc_mac";
                        break;
                    case SyncDeviceType.Windows:
                        iconName = "pc_windows";
                        break;
                    case SyncDeviceType.iPhone:
                        iconName = "phone_iphone";
                        break;
                    case SyncDeviceType.iPad:
                        iconName = "tablet_ipad";
                        break;
                    case SyncDeviceType.AndroidPhone:
                        iconName = "phone_android";
                        break;
                    case SyncDeviceType.AndroidTablet:
                        iconName = "tablet_android";
                        break;
                    case SyncDeviceType.WindowsPhone:
                        iconName = "phone_windows";
                        break;
                    case SyncDeviceType.WindowsStore:
                        iconName = "tablet_windows";
                        break;
                }
                var frameImageView = view.ImageView.Frame;
                frameImageView.Height = 24;
                frameImageView.Width = 24;
                frameImageView.Y = view.Frame.Height - 26;
                view.ImageView.Frame = frameImageView;
                view.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == iconName);
            }

            var frame = view.TextField.Frame;
            frame.X = tableColumn.Identifier == "columnDeviceName" ? 30 : -2;
            frame.Y = view.Frame.Height - 19;
            view.TextField.Frame = frame;
            view.TextField.Font = NSFont.FromFontName("Roboto", 12);

            return view;
        }
Esempio n. 8
0
        public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            NSTableCellView view;
            if(tableColumn.Identifier.ToString() == "columnDeviceName")
            {
                view = (NSTableCellView)tableView.MakeView("cellDeviceName", this);
                view.TextField.StringValue = _items[row].Name;
            }
            else
            {
                view = (NSTableCellView)tableView.MakeView("cellDeviceDescription", this);
                view.TextField.StringValue = _items[row].Url;
            }
            //view.TextField.Font = NSFont.FromFontName("Junction", 11);

            if (view.ImageView != null)
            {
                string iconName = string.Empty;
                switch (_items[row].DeviceType)
                {
                    case SyncDeviceType.iOS:
                        iconName = "16_icomoon_apple";
                        break;
                    case SyncDeviceType.Android:
                        iconName = "16_icomoon_android";
                        break;
                    default:
                        iconName = "16_icomoon_laptop";
                        break;
                }
                view.ImageView.Image = ImageResources.images16x16.FirstOrDefault(x => x.Name == iconName);
            }
            return view;
        }
Esempio n. 9
0
        public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            NSTableCellView view;
            if(tableColumn.Identifier.ToString() == "columnName")
            {
                view = (NSTableCellView)tableView.MakeView("cellName", this);
                view.TextField.StringValue = _presets[row].Name;
            }
            else
            {
                view = (NSTableCellView)tableView.MakeView("cellEqualizer", this);
            }

            view.TextField.Font = NSFont.FromFontName("Roboto", 12);

            return view;
        }
Esempio n. 10
0
 public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
 {
     NSTableCellView view = (NSTableCellView)tableView.MakeView("cellSelection", this);
     var audioFile = _selection[row];
     string title = string.Format("{0} / {1} / {2}. {3}", audioFile.ArtistName, audioFile.AlbumTitle, audioFile.TrackNumber, audioFile.Title);
     view.TextField.StringValue = title;
     view.TextField.Font = NSFont.FromFontName("Roboto", 11);
     return view;
 }
Esempio n. 11
0
        public NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, int row)
        {
            SessionsTableCellView view;           
            view = (SessionsTableCellView)tableView.MakeView(tableColumn.Identifier.ToString().Replace("column", "cell"), this);
            view.TextField.Font = NSFont.FromFontName("Roboto", 11);

            bool adjustXPadding = false;
            if (tableView.Identifier == "tableMarkers")
            {
                adjustXPadding = tableMarkers.FindColumn(new NSString(tableColumn.Identifier)) > 0;

                if (tableColumn.Identifier.ToString() == "columnMarkerIndex")
                {
                    view.IndexLabel.StringValue = string.Format("{0}", Conversion.IndexToLetter(row));
                    view.IndexBackground.BackgroundColor1 = new CGColor(1, 0, 0);
                    view.IndexBackground.BackgroundColor2 = new CGColor(1, 0, 0);
                }
                else if (tableColumn.Identifier.ToString() == "columnMarkerName")
                    view.TextField.StringValue = _markers[row].Name;
                else if (tableColumn.Identifier.ToString() == "columnMarkerPosition")
                    view.TextField.StringValue = _markers[row].Position;
                else
                    view.TextField.StringValue = string.Empty;
            } 
            else if (tableView.Identifier == "tableLoops")
            {
                adjustXPadding = tableLoops.FindColumn(new NSString(tableColumn.Identifier)) > 0;

                if (tableColumn.Identifier.ToString() == "columnLoopIndex")
                {
                    view.IndexLabel.StringValue = string.Format("{0}", Conversion.IndexToLetter(row));
                    view.IndexBackground.BackgroundColor1 = new CGColor(0, 0, 1);
                    view.IndexBackground.BackgroundColor2 = new CGColor(0, 0, 1);
                }
                else if (tableColumn.Identifier.ToString() == "columnLoopName")
                    view.TextField.StringValue = _loops[row].Name;
                else if (tableColumn.Identifier.ToString() == "columnLoopSegments")
                    view.TextField.StringValue = _loops[row].Segments.Count.ToString();
                else if (tableColumn.Identifier.ToString() == "columnLoopTotalLength")
                    view.TextField.StringValue = "0:00";
                else
                    view.TextField.StringValue = string.Empty;
            }
            else if (tableView.Identifier == "tableSegments")
            {
                adjustXPadding = tableSegments.FindColumn(new NSString(tableColumn.Identifier)) > 0;

                if (tableColumn.Identifier.ToString() == "columnSegmentIndex")
                {               
                    view.IndexLabel.StringValue = string.Format("{0}", row + 1);
                    view.IndexBackground.BackgroundColor1 = new CGColor(0, 0, 1);
                    view.IndexBackground.BackgroundColor2 = new CGColor(0, 0, 1);
                }
                else if (tableColumn.Identifier.ToString() == "columnSegmentMarker")
                {
                    string markerName = string.Empty;
                    if (_currentLoop.Segments[row].MarkerId != Guid.Empty)
                    {
                        var marker = _markers.FirstOrDefault(x => x.MarkerId == _currentLoop.Segments[row].MarkerId);
                        if (marker != null)
                            markerName = marker.Name;
                    }
                    view.TextField.StringValue = markerName;
                }
                else if (tableColumn.Identifier.ToString() == "columnSegmentPosition")
                    view.TextField.StringValue = _currentLoop.Segments[row].Position;
                else
                    view.TextField.StringValue = string.Empty;
            }

            view.TextField.Frame = new RectangleF(adjustXPadding ? -2 : 0, -2, view.Frame.Width, view.Frame.Height);

            if (tableColumn.Identifier.ToString() == "columnMarkerIndex" ||
                tableColumn.Identifier.ToString() == "columnLoopIndex" ||
                tableColumn.Identifier.ToString() == "columnSegmentIndex")
            {
                view.SetTheme(SessionsTableCellView.CellTheme.Index);
            }
            else
            {
                view.SetTheme(SessionsTableCellView.CellTheme.Normal);
            }
                
            return view;
        }