SetToolByName() public method

public SetToolByName ( string toolName ) : void
toolName string
return void
コード例 #1
0
        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;
        }
コード例 #2
0
        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;
            }
        }