本文整理汇总了C#中IDrawingView.ClearSelection方法的典型用法代码示例。如果您正苦于以下问题:C# IDrawingView.ClearSelection方法的具体用法?C# IDrawingView.ClearSelection怎么用?C# IDrawingView.ClearSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDrawingView
的用法示例。
在下文中一共展示了IDrawingView.ClearSelection方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeStart
public override void InvokeStart(double x, double y, IDrawingView view)
{
m_connection = CreateConnection();
m_connection.EndPoint = new PointD (x, y);
m_connection.StartPoint = new PointD (x, y);
m_connection.ConnectStart (Owner.ConnectorAt(x, y));
m_connection.UpdateConnection();
view.Drawing.Add(m_connection);
view.ClearSelection();
view.AddToSelection(m_connection);
m_handle = view.FindHandle(x, y);
}
示例2: InvokeEnd
public override void InvokeEnd(double x, double y, IDrawingView view)
{
if (m_handle != null) {
m_handle.InvokeEnd(x, y, view);
}
if (m_connection.EndConnector == null) {
m_connection.DisconnectStart ();
m_connection.DisconnectEnd ();
view.Drawing.Remove(m_connection);
view.ClearSelection();
}
}
示例3: DeleteFigures
private void DeleteFigures (IDrawingView view) {
List <IFigure> figures = new List <IFigure> ();
foreach (IFigure fig in view.SelectionEnumerator) {
figures.Add (fig);
}
view.ClearSelection ();
foreach (IFigure fig in figures) {
view.Drawing.Remove (fig);
}
}
示例4: InvokeEnd
public override void InvokeEnd(double x, double y, IDrawingView view)
{
if (_handle != null) {
_handle.InvokeEnd(x, y, view);
}
if (_connection.EndConnector == null) {
IFigure new_figure = CreateEndFigure();
new_figure.MoveTo(x, y);
view.Drawing.Add(new_figure);
_connection.ConnectEnd(new_figure.ConnectorAt(0.0, 0.0));
_connection.UpdateConnection();
view.ClearSelection();
view.AddToSelection(new_figure);
}
}
示例5: InvokeStart
public override void InvokeStart(double x, double y, IDrawingView view)
{
if (Owner is TableFigure) {
_clicked = !_clicked;
TableFigure f = (TableFigure)Owner;
if (_locator is IndexLocator) {
//Show/Hide Indexes
if (f.showIndexes) {
foreach (Index indx in f.Model.indexes) {
f.Remove (indx);
}
f.showIndexes = false;
} else {
foreach (Index indx in f.Model.indexes) {
f.Add (indx);
}
f.showIndexes = true;
}
}
if (_locator is TriggerLocator) {
//Show/Hide Triggers
if (f.showTriggers) {
foreach (Trigger trg in f.Model.triggers) {
f.Remove (trg);
}
f.showTriggers = false;
} else {
foreach (Trigger trg in f.Model.triggers) {
f.Add (trg);
}
f.showTriggers = true;
}
}
if (_locator is ColumnAddLocator){
//Add a new column to table
f.addNewColumn();
}
if (_locator is ColumnRemoveLocator){
//Activate a state where the figure wait for the user to click a column and then delete it
f.activateRemoveColumn();
}
if (_locator is ForeignKeyLocator){
//Start Creation of Foreign Key
RelationshipFigure rel = new RelationshipFigure ();
f.figureCanvas.Tool = new ConnectionCreationTool (f.figureCanvas, rel);
f.figureCanvas.Tool.MouseDown(new MouseEvent(f.figureCanvas.View,null,new Cairo.PointD(x,y)));
}
if (_locator is RemoveTableLocator){
//Remove Table Selected
f.unPopulateTable();
//view.ToggleSelection(f);
view.ClearSelection ();
view.Drawing.Remove(f);
view.Remove(f);
List<RelationshipFigure> deleteFigures = new List<RelationshipFigure>();
foreach ( IFigure fig in view.Drawing.FiguresEnumerator){
if(fig is RelationshipFigure){
TableFigure startTable=((fig as RelationshipFigure).StartFigure as TableFigure);
TableFigure endTable=((fig as RelationshipFigure).EndFigure as TableFigure);
if(startTable.Model.Name==f.Model.Name || endTable.Model.Name==f.Model.Name)
deleteFigures.Add(fig as RelationshipFigure);
}
}
if(deleteFigures.Count>0){
view.ClearSelection ();
foreach(RelationshipFigure delRelationship in deleteFigures){
view.Drawing.Remove(delRelationship);
}
}
}
}
}
示例6: DeleteFigures
private void DeleteFigures(IDrawingView view)
{
IEnumerable<Figure> figures = view.SelectionEnumerator.ToFigures ();
view.ClearSelection ();
view.RemoveRange (figures);
}