本文整理汇总了C#中IDrawableContainer.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# IDrawableContainer.Invalidate方法的具体用法?C# IDrawableContainer.Invalidate怎么用?C# IDrawableContainer.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDrawableContainer
的用法示例。
在下文中一共展示了IDrawableContainer.Invalidate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectElement
/// <summary>
/// Select the supplied element
/// </summary>
/// <param name="container"></param>
public void SelectElement(IDrawableContainer container)
{
if (!selectedElements.Contains(container))
{
selectedElements.Add(container);
container.ShowGrippers();
container.Selected = true;
FieldAggregator.BindElement(container);
if (_movingElementChanged != null)
{
SurfaceElementEventArgs eventArgs = new SurfaceElementEventArgs();
eventArgs.Elements = selectedElements;
_movingElementChanged(this, eventArgs);
}
container.Invalidate();
}
}
示例2: AddElement
/// <summary>
/// Add a new element to the surface
/// </summary>
/// <param name="element">the new element</param>
/// <param name="makeUndoable">true if the adding should be undoable</param>
public void AddElement(IDrawableContainer element, bool makeUndoable)
{
_elements.Add(element);
DrawableContainer container = element as DrawableContainer;
if (container != null)
{
container.FieldChanged += element_FieldChanged;
}
element.PropertyChanged += ElementPropertyChanged;
if (element.Status == EditStatus.UNDRAWN)
{
element.Status = EditStatus.IDLE;
}
element.Invalidate();
if (makeUndoable)
{
MakeUndoable(new AddElementMemento(this, element), false);
}
_modified = true;
}
示例3: RemoveElement
/// <summary>
/// Remove an element of the elements list
/// </summary>
/// <param name="elementToRemove">Element to remove</param>
/// <param name="makeUndoable">flag specifying if the remove needs to be undoable</param>
public void RemoveElement(IDrawableContainer elementToRemove, bool makeUndoable)
{
DeselectElement(elementToRemove);
elements.Remove(elementToRemove);
DrawableContainer element = elementToRemove as DrawableContainer;
if (element != null)
{
element.FieldChanged -= element_FieldChanged;
}
elementToRemove.PropertyChanged -= ElementPropertyChanged;
// Do not dispose, the memento should!! element.Dispose();
elementToRemove.Invalidate();
if (makeUndoable)
{
MakeUndoable(new DeleteElementMemento(this, elementToRemove), false);
}
modified = true;
}