当前位置: 首页>>代码示例>>C#>>正文


C# IDiagramPresenter.DiagramToControl方法代码示例

本文整理汇总了C#中IDiagramPresenter.DiagramToControl方法的典型用法代码示例。如果您正苦于以下问题:C# IDiagramPresenter.DiagramToControl方法的具体用法?C# IDiagramPresenter.DiagramToControl怎么用?C# IDiagramPresenter.DiagramToControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDiagramPresenter的用法示例。


在下文中一共展示了IDiagramPresenter.DiagramToControl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Construct

		private void Construct(IDiagramPresenter owner, ICaptionedShape shape, int captionIndex, string currentText, string newText) {
			if (owner == null) throw new ArgumentNullException("owner");
			if (shape == null) throw new ArgumentNullException("shape");
			if (captionIndex < 0 || captionIndex >= shape.CaptionCount) throw new ArgumentOutOfRangeException("captionIndex");
			// Set control styles
			SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
			UpdateStyles();

			// Set general properties
			this.BackColor = Color.Transparent;	// Does not matter - see CreateParams()
			this.AutoScrollOffset = Point.Empty;
			this.ScrollBars = RichTextBoxScrollBars.None;
			this.BorderStyle = BorderStyle.None;

			// Set caption / style specific properties
			this.owner = owner;
			this.shape = shape;
			this.captionIndex = captionIndex;
			// Set Styles here because the ParagraphStyle is needed for resizing
			characterStyle = shape.GetCaptionCharacterStyle(captionIndex);
			paragraphStyle = shape.GetCaptionParagraphStyle(captionIndex);

			// set base' members
			SuspendLayout();
			try {
				this.WordWrap = paragraphStyle.WordWrap;
				this.Font = ToolCache.GetFont(characterStyle);
				this.ZoomFactor = owner.ZoomLevel / 100f;

				// Get line height
				Size textSize = TextRenderer.MeasureText(((IDisplayService)owner).InfoGraphics, "Iq", Font);
				owner.DiagramToControl(textSize, out textSize);
				lineHeight = textSize.Height;

				DoUpdateBounds();

				SelectAll();
				SelectionAlignment = ConvertToHorizontalAlignment(paragraphStyle.Alignment);
				DeselectAll();
			} finally {
				ResumeLayout();
			}
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:43,代码来源:InplaceTextBox.cs

示例2: IsMinRotateRangeExceeded

		private bool IsMinRotateRangeExceeded(IDiagramPresenter diagramPresenter, MouseState mouseState) {
			if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
			if (mouseState == MouseState.Empty) throw new ArgumentException("mouseState");
			Point p;
			if (PendingToolActionsCount <= 1) p = ActionStartMouseState.Position;
			else {
				MouseState prevMouseState = GetPreviousMouseState();
				p = prevMouseState.Position;
			}
			Debug.Assert(Geometry.IsValid(p));
			int dist = (int)Math.Round(Geometry.DistancePointPoint(p.X, p.Y, mouseState.X, mouseState.Y));
			diagramPresenter.DiagramToControl(dist, out dist);
			return (dist > diagramPresenter.MinRotateRange);
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:14,代码来源:Tool.cs


注:本文中的IDiagramPresenter.DiagramToControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。