Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/10 14:28:32 (14 years ago)
Author:
mkommend
Message:

implemented application review comments from abeham (ticket #867)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/GraphVisualizationInfoView.cs

    r3386 r3514  
    4242  [View("GraphVisualizationInfo View")]
    4343  [Content(typeof(IGraphVisualizationInfo), true)]
    44   public partial class GraphVisualizationInfoView : ContentView {
     44  public partial class GraphVisualizationInfoView : AsynchronousContentView {
    4545    private BidirectionalLookup<IShapeInfo, IShape> shapeInfoShapeMapping;
    4646    private BidirectionalLookup<IConnectionInfo, IConnection> connectionInfoConnectionMapping;
     
    7878      this.SetEnabledStateOfControls();
    7979    }
     80    protected override void OnLockedChanged() {
     81      base.OnLockedChanged();
     82      this.SetEnabledStateOfControls();
     83    }
    8084    private void SetEnabledStateOfControls() {
    8185      DeleteTool deleteTool = (DeleteTool)this.Controller.Tools.Where(t => t.Name == ControllerBase.DeleteToolName).FirstOrDefault();
     
    8488        controller.RemoveTool(deleteTool);
    8589      else {
    86         if (ReadOnly && deleteTool != null && controller != null)
     90        if ((ReadOnly || Locked) && deleteTool != null && controller != null)
    8791          controller.RemoveTool(deleteTool);
    88         else if (!ReadOnly && deleteTool == null)
     92        else if ((!ReadOnly && !Locked) && deleteTool == null)
    8993          this.Controller.AddTool(new DeleteTool(ControllerBase.DeleteToolName));
    9094      }
     
    171175    }
    172176    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      }
    182187    }
    183188
     
    240245      this.connectionInfoConnectionMapping.RemoveByFirst(connectionInfo);
    241246      this.RemoveConnection(connection);
    242      
     247
    243248    }
    244249    private void RemoveConnection(IConnection connection) {
Note: See TracChangeset for help on using the changeset viewer.