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


C# IDrawingView.Remove方法代码示例

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


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

示例1: 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);
                     }
                 }
         }
     }
 }
开发者ID:xiul,项目名称:Monodevelop-Database-Modeler-Addin,代码行数:72,代码来源:ButtonHandle.cs


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