public void CreateImageAtXY(string imageKey, double x, double y) { PixbufRepository.AddOrUpdatePixbufByName(imageKey); var point = new Cairo.PointD(x / Zoom, y / Zoom); var sectionView = getSectionViewByXY(x, y); var localpoint = sectionView.PointInSectionByAbsolutePoint(point); ToolBoxService.SetToolByName("ImageTool"); SelectedTool.CreateNewControl(sectionView); var image = (SelectedControl.ControlModel as Image); image.ImageKey = imageKey; image.Location = new MonoReports.Model.Point(localpoint.X, localpoint.Y); SelectedTool.CreateMode = false; }
public void CreateTextBlockAtXY(string text, string fieldName, FieldKind fieldKind, double x, double y) { var point = new Cairo.PointD(x / Zoom, y / Zoom); var sectionView = getSectionViewByXY(x, y); if (sectionView != null) { var localpoint = sectionView.PointInSectionByAbsolutePoint(point); ToolBoxService.SetToolByName("TextBlockTool"); SelectedTool.CreateNewControl(sectionView); var textBlock = (SelectedControl.ControlModel as TextBlock); textBlock.Text = fieldName; textBlock.FieldName = fieldName; textBlock.FieldKind = fieldKind; textBlock.Location = new MonoReports.Model.Point(localpoint.X, localpoint.Y); SelectedTool.CreateMode = false; } }