本文整理汇总了C#中Shape.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.Invalidate方法的具体用法?C# Shape.Invalidate怎么用?C# Shape.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shape
的用法示例。
在下文中一共展示了Shape.Invalidate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoInvalidateShape
private void DoInvalidateShape(IDiagramPresenter diagramPresenter, Shape shape, bool invalidateGrips)
{
if (shape.Parent != null)
DoInvalidateShape(diagramPresenter, shape.Parent, false);
else {
shape.Invalidate();
if (invalidateGrips)
diagramPresenter.InvalidateGrips(shape, ControlPointCapabilities.All);
}
}
示例2: SetTemplateShape
/// <summary>
/// Set the given shape as the template's shape.
/// </summary>
public void SetTemplateShape(Shape newShape)
{
if (newShape == null) throw new ArgumentNullException("newShape");
// buffer the current template shape
Shape oldShape = workTemplate.Shape;
if (oldShape != null)
oldShape.Invalidate();
// set the new template shape
newShape.DisplayService = this;
newShape.Invalidate();
workTemplate.Shape = newShape;
TemplateWasChanged = true;
if (TemplateShapeChanged != null) {
shapeReplacedEventArgs.Template = workTemplate;
shapeReplacedEventArgs.OldTemplateShape = oldShape;
shapeReplacedEventArgs.NewTemplateShape = newShape;
TemplateShapeChanged(this, shapeReplacedEventArgs);
}
}
示例3: AddShapeToLayers
/// <summary>
/// Associates the given <see cref="T:Dataweb.NShape.Advanced.Shape" /> to all specified layers.
/// </summary>
public void AddShapeToLayers(Shape shape, LayerIds layerIds)
{
if (shape == null) throw new ArgumentNullException("shape");
shape.Layers |= layerIds;
shape.Invalidate();
}
示例4: RemoveShapeFromLayers
/// <summary>
/// Disociates the given <see cref="T:Dataweb.NShape.Advanced.Shape" /> to all specified layers.
/// </summary>
public void RemoveShapeFromLayers(Shape shape, LayerIds layerIds)
{
if (shape == null) throw new ArgumentNullException("shape");
if (layerIds == LayerIds.None) return;
if (layerIds == LayerIds.All)
shape.Layers = LayerIds.None;
else shape.Layers ^= (shape.Layers & layerIds);
shape.Invalidate();
}
示例5: ReplaceCore
/// <override></override>
protected override void ReplaceCore(Shape oldShape, Shape newShape)
{
base.ReplaceCore(oldShape, newShape);
oldShape.Diagram = null;
oldShape.Invalidate();
oldShape.DisplayService = null;
newShape.Diagram = owner;
newShape.DisplayService = owner.DisplayService;
newShape.Invalidate();
CheckOwnerboundsUpdateNeeded(oldShape);
CheckOwnerboundsUpdateNeeded(newShape);
if (shapeCounter > 0) --shapeCounter;
if (shapeCounter == 0) DoUpdateOwnerBounds();
}
示例6: RemoveCore
/// <override></override>
protected override bool RemoveCore(Shape shape)
{
bool result = base.RemoveCore(shape);
shape.Invalidate();
shape.DisplayService = null;
shape.Diagram = null;
CheckOwnerboundsUpdateNeeded(shape);
if (shapeCounter > 0) --shapeCounter;
if (shapeCounter == 0) DoUpdateOwnerBounds();
return result;
}
示例7: InsertCore
/// <override></override>
protected override int InsertCore(int index, Shape shape)
{
int result = base.InsertCore(index, shape);
shape.Diagram = owner;
shape.DisplayService = owner.DisplayService;
shape.Invalidate();
CheckOwnerboundsUpdateNeeded(shape);
if (shapeCounter > 0) --shapeCounter;
if (shapeCounter == 0) DoUpdateOwnerBounds();
return result;
}
示例8: DeletePreviewShape
/// <summary>
/// Disconnect, disposes and deletes the given preview <see cref="T:Dataweb.NShape.Advanced.Shape" />.
/// </summary>
/// <param name="shape"></param>
protected void DeletePreviewShape(ref Shape shape) {
if (shape != null) {
// Disconnect all existing connections (disconnects model, too)
foreach (ControlPointId pointId in shape.GetControlPointIds(ControlPointCapabilities.Connect | ControlPointCapabilities.Glue)) {
ControlPointId otherPointId = shape.IsConnected(pointId, null);
if (otherPointId != ControlPointId.None) shape.Disconnect(pointId);
}
// Delete model obejct
if (shape.ModelObject != null)
shape.ModelObject = null;
// Delete shape
shape.Invalidate();
shape.Dispose();
shape = null;
}
}
示例9: RemovePreview
private void RemovePreview(Shape previewShape) {
Shape origShape = null;
if (!originalShapes.TryGetValue(previewShape, out origShape))
throw new NShapeInternalException("This preview shape has no associated original shape in this tool.");
else {
// Invalidate Preview Shape
previewShape.Invalidate();
// Remove both, original- and preview shape from the appropriate dictionaries
previewShapes.Remove(origShape);
originalShapes.Remove(previewShape);
}
}