void CreatePageHeader(ReportWizardContext context) { var pushModelContext = (PushModelContext)context.PushModelContext; foreach (var element in pushModelContext.Items) { var dataItem = new BaseTextItem() { Name = element.ColumnName, Text = element.ColumnName }; ReportModel.PageHeader.Items.Add(dataItem); } AdjustItems(ReportModel.PageHeader.Items, startLocation); var line = new BaseLineItem() { Location = new Point(2, 35), FromPoint = new Point(1, 1), ToPoint = new Point(ReportModel.ReportSettings.PrintableWidth() - 10, 1), Size = new Size(ReportModel.ReportSettings.PrintableWidth() - 5, 5) }; ReportModel.PageHeader.Items.Add(line); }
public override void Initialize(IComponent component) { if (component == null) { throw new ArgumentNullException("component"); } base.Initialize(component); baseLine = (BaseLineItem)component; }
protected override void OnPaintAdornments(PaintEventArgs pe) { BaseLineItem label = (BaseLineItem)Control; if (selectionService != null) { if (selectionService.GetComponentSelected(label)) { // Paint grab handles. Rectangle grapRectangle = GetHandle(label.FromPoint); ControlPaint.DrawGrabHandle(pe.Graphics, grapRectangle, true, true); grapRectangle = GetHandle(label.ToPoint); ControlPaint.DrawGrabHandle(pe.Graphics, grapRectangle, true, true); } } }
protected override void OnSetCursor( ) { // Get mouse cursor position relative to // the control's coordinate space. BaseLineItem label = (BaseLineItem)Control; Point p = label.PointToClient(Cursor.Position); // Display a resize cursor if the mouse is // over a grab handle; otherwise show a // normal arrow. if (GetHandle(label.FromPoint).Contains(p) || GetHandle(label.ToPoint).Contains(p)) { Cursor.Current = Cursors.SizeAll; } else { Cursor.Current = Cursors.Default; } }
public override void Initialize(IComponent component) { if (component == null) { throw new ArgumentNullException("component"); } base.Initialize(component); this.baseLine = (BaseLineItem)component; this.componentChangeService = (IComponentChangeService)component.Site.GetService(typeof(IComponentChangeService)); if (componentChangeService != null) { componentChangeService.ComponentChanging += OnComponentChanging; componentChangeService.ComponentChanged += OnComponentChanged; componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); } selectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (selectionService != null) { selectionService.SelectionChanged += OnSelectionChanged; } }
public override void Initialize(IComponent component) { if (component == null) { throw new ArgumentNullException("component"); } base.Initialize(component); this.baseLine = (BaseLineItem)component; this.componentChangeService = (IComponentChangeService)component.Site.GetService(typeof(IComponentChangeService)); if (componentChangeService != null) { componentChangeService.ComponentChanging += OnComponentChanging; componentChangeService.ComponentChanged += OnComponentChanged; componentChangeService.ComponentRename += new ComponentRenameEventHandler(OnComponentRename); } selectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (selectionService != null) { selectionService.SelectionChanged += OnSelectionChanged; } }