public TableColumn(ApplicationContext context, ICellSource backend, NSTableView table) { this.context = context; Identifier = GetHashCode().ToString(); // this is used to identify cached views this.backend = backend; TableView = table; }
public static NSCell CreateCell(ICellSource source, ICollection<CellView> cells) { CompositeCell c = new CompositeCell (Orientation.Horizontal, source); foreach (var cell in cells) c.AddCell ((ICellRenderer) CreateCell (c, cell)); return c; }
void ICopiableObject.CopyFrom(object other) { var ob = (CompositeCell)other; if (ob.source == null) { throw new ArgumentException("Cannot copy from a CompositeCell with a null `source`"); } context = ob.context; source = ob.source; val = ob.val; tablePosition = ob.tablePosition; direction = ob.direction; trackingCell = ob.trackingCell; cells = new List <ICellRenderer> (); foreach (var c in ob.cells) { var copy = (ICellRenderer)Activator.CreateInstance(c.GetType()); copy.CopyFrom(c); AddCell(copy); } if (tablePosition != null) { Fill(); } }
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; }
public CompositeCell (ApplicationContext context, Orientation dir, ICellSource source) { if (source == null) throw new ArgumentNullException ("source"); direction = dir; this.context = context; this.source = source; }
public static void UpdateCellView(CompositeCell cellView, ICellSource source, ICollection <CellView> cells, int column) { cellView.ClearCells(); foreach (var cell in cells) { cellView.AddCell((ICellRenderer)CreateCellView(source, cell, column)); } }
public static NSCell CreateCell(ICellSource source, CellView cell) { if (cell is TextCellView) return new TextTableCell ((TextCellView) cell); if (cell is ImageCellView) return new ImageTableCell ((ImageCellView) cell); throw new NotImplementedException (); }
public CompositeCell(ApplicationContext context, ICellSource source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } this.context = context; this.source = source; }
public void Fill(ICellSource source, object pos) { Image img = (Image)source.GetValue(pos, cellView.ImageField.Index); if (img != null) { ObjectValue = (NSImage)WidgetRegistry.GetBackend(img); } }
public static NSCell CreateCell(NSTableView table, ICellSource source, ICollection <CellView> cells, int column) { CompositeCell c = new CompositeCell(Orientation.Horizontal, source); foreach (var cell in cells) { c.AddCell((ICellRenderer)CreateCell(table, c, cell, column)); } return(c); }
public static NSCell CreateCell(ICellSource source, ICollection<CellView> cells) { // if (cells.Count > 1) { CompositeCell c = new CompositeCell (Orientation.Horizontal, source); foreach (var cell in cells) c.AddCell ((ICellRenderer) CreateCell (source, cell)); return c; // } else // return CreateCell (source, cells.First ()); }
public static CompositeCell CreateCellView(ApplicationContext context, ICellSource source, ICollection <CellView> cells, int column) { CompositeCell c = new CompositeCell(context, source); foreach (var cell in cells) { c.AddCell((ICellRenderer)CreateCellView(source, cell, column)); } return(c); }
public CompositeCell(ApplicationContext context, Orientation dir, ICellSource source) { if (source == null) { throw new ArgumentNullException("source"); } direction = dir; this.context = context; this.source = source; }
public static NSCell CreateCell(ICellSource source, ICollection <CellView> cells) { CompositeCell c = new CompositeCell(Orientation.Horizontal, source); foreach (var cell in cells) { c.AddCell((ICellRenderer)CreateCell(c, cell)); } return(c); }
public static NSCell CreateCell(ICellSource source, CellView cell) { if (cell is TextCellView) { return(new TextTableCell((TextCellView)cell)); } if (cell is ImageCellView) { return(new ImageTableCell((ImageCellView)cell)); } throw new NotImplementedException(); }
public static NSCell CreateCell(ICellSource source, ICollection <CellView> cells) { // if (cells.Count > 1) { CompositeCell c = new CompositeCell(Orientation.Horizontal, source); foreach (var cell in cells) { c.AddCell((ICellRenderer)CreateCell(source, cell)); } return(c); // } else // return CreateCell (source, cells.First ()); }
static NSView CreateCellView(ICellSource source, CellView cell, int column) { ICellRenderer cr = null; if (cell is ITextCellViewFrontend) { cr = new TextTableCell(); } else if (cell is IImageCellViewFrontend) { cr = new ImageTableCell(); } else if (cell is ICanvasCellViewFrontend) { cr = new CanvasTableCell(); } else if (cell is ICheckBoxCellViewFrontend) { cr = new CheckBoxTableCell(); } else if (cell is IRadioButtonCellViewFrontend) { cr = new RadioButtonTableCell(); } else { throw new NotImplementedException(); } ICellViewFrontend fr = cell; CellViewBackend backend = null; try { //FIXME: although the cell views are based on XwtComponent, they don't implement // the dynamic registration based backend creation and there is no way to // identify whether the frontend has already a valid backend. backend = cell.GetBackend() as CellViewBackend; } catch (InvalidOperationException) { } if (backend == null) { cr.Backend = new CellViewBackend(source.TableView, column); fr.AttachBackend((source as ViewBackend).Frontend, cr.Backend); } else { cr.Backend = backend; } return((NSView)cr); }
void ICopiableObject.CopyFrom (object other) { var ob = (CompositeCell)other; context = ob.context; source = ob.source; val = ob.val; tablePosition = ob.tablePosition; direction = ob.direction; trackingCell = ob.trackingCell; cells = new List<ICellRenderer> (); foreach (var c in ob.cells) { var copy = (ICellRenderer) Activator.CreateInstance (c.GetType ()); copy.CopyFrom (c); AddCell (copy); } if (tablePosition != null) Fill (); }
void ICopiableObject.CopyFrom(object other) { var ob = (CompositeCell)other; source = ob.source; val = ob.val; tablePosition = ob.tablePosition; direction = ob.direction; trackingCell = ob.trackingCell; cells = new List <ICellRenderer> (); foreach (var c in ob.cells) { var copy = (ICellRenderer)Activator.CreateInstance(c.GetType()); copy.CopyFrom(c); AddCell(copy); } if (tablePosition != null) { Fill(); } }
public void Fill(ICellSource source, object pos) { Image img = (Image) source.GetValue (pos, cellView.ImageField.Index); if (img != null) ObjectValue = (NSImage) WidgetRegistry.GetBackend (img); }
public CompositeCell(Orientation dir, ICellSource source) { direction = dir; this.source = source; }
public CompositeCell(ApplicationContext context, Orientation dir, ICellSource source) { direction = dir; this.context = context; this.source = source; }
public void Fill(ICellSource source, object pos) { StringValue = (string) source.GetValue (pos, cellView.TextField.Index) ?? ""; }
public void Fill(ICellSource source, object pos) { StringValue = (string)source.GetValue(pos, cellView.TextField.Index) ?? ""; }