Changeset 3514 for trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/GraphVisualizationInfoView.cs
- Timestamp:
- 04/23/10 14:28:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/GraphVisualizationInfoView.cs
r3386 r3514 42 42 [View("GraphVisualizationInfo View")] 43 43 [Content(typeof(IGraphVisualizationInfo), true)] 44 public partial class GraphVisualizationInfoView : ContentView {44 public partial class GraphVisualizationInfoView : AsynchronousContentView { 45 45 private BidirectionalLookup<IShapeInfo, IShape> shapeInfoShapeMapping; 46 46 private BidirectionalLookup<IConnectionInfo, IConnection> connectionInfoConnectionMapping; … … 78 78 this.SetEnabledStateOfControls(); 79 79 } 80 protected override void OnLockedChanged() { 81 base.OnLockedChanged(); 82 this.SetEnabledStateOfControls(); 83 } 80 84 private void SetEnabledStateOfControls() { 81 85 DeleteTool deleteTool = (DeleteTool)this.Controller.Tools.Where(t => t.Name == ControllerBase.DeleteToolName).FirstOrDefault(); … … 84 88 controller.RemoveTool(deleteTool); 85 89 else { 86 if ( ReadOnly&& deleteTool != null && controller != null)90 if ((ReadOnly || Locked) && deleteTool != null && controller != null) 87 91 controller.RemoveTool(deleteTool); 88 else if ( !ReadOnly&& deleteTool == null)92 else if ((!ReadOnly && !Locked) && deleteTool == null) 89 93 this.Controller.AddTool(new DeleteTool(ControllerBase.DeleteToolName)); 90 94 } … … 171 175 } 172 176 private void RemoveShapeInfo(IShapeInfo shapeInfo) { 173 this.DeregisterShapeInfoEvents(shapeInfo); 174 IShape shape = this.shapeInfoShapeMapping.GetByFirst(shapeInfo); 175 this.DeregisterShapeEvents(shape); 176 this.shapeInfoShapeMapping.RemoveByFirst(shapeInfo); 177 178 if (this.graphVisualization.Controller.Model.Shapes.Contains(shape)) { 179 this.graphVisualization.Controller.Model.RemoveShape(shape); 180 this.graphVisualization.Invalidate(); 181 } 177 this.DeregisterShapeInfoEvents(shapeInfo); 178 IShape shape = this.shapeInfoShapeMapping.GetByFirst(shapeInfo); 179 this.DeregisterShapeEvents(shape); 180 this.shapeInfoShapeMapping.RemoveByFirst(shapeInfo); 181 182 if (this.graphVisualization.Controller.Model.Shapes.Contains(shape)) { 183 this.graphVisualization.Controller.Model.RemoveShape(shape); 184 this.graphVisualization.Controller.Model.Selection.Clear(); 185 this.graphVisualization.Invalidate(); 186 } 182 187 } 183 188 … … 240 245 this.connectionInfoConnectionMapping.RemoveByFirst(connectionInfo); 241 246 this.RemoveConnection(connection); 242 247 243 248 } 244 249 private void RemoveConnection(IConnection connection) {
Note: See TracChangeset
for help on using the changeset viewer.