Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/03/14 02:20:19 (10 years ago)
Author:
swagner
Message:

#2205: Worked on optimization networks

Location:
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/AlgorithmNode.cs

    r11409 r11412  
    8383        if (algorithm.Parameters.TryGetValue(port.Name, out param)) {
    8484          IValueParameter p = param as IValueParameter;
    85           if (p != null) {
     85          if ((p != null) && (port.Value != null)) {
    8686            p.Value = (IItem)port.Value;
    8787          }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj

    r11406 r11412  
    4848  </ItemGroup>
    4949  <ItemGroup>
     50    <Compile Include="IVariablesNode.cs" />
     51    <Compile Include="VariablesNode.cs" />
    5052    <Compile Include="EventArgs.cs" />
    5153    <Compile Include="IInputOutputPort.cs" />
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IInputOutputPort.cs

    r11406 r11412  
    2626  public interface IInputOutputPort : IPort {
    2727    IOutputInputPort OutputInputPort { get; }
     28
     29    event EventHandler OutputInputPortChanged;
    2830  }
    2931
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IInputPort.cs

    r11401 r11412  
    2020#endregion
    2121
     22using HeuristicLab.Core;
    2223using System;
    23 using HeuristicLab.Core;
    2424
    2525namespace HeuristicLab.Optimization.Networks {
    2626  public interface IInputPort : IPort {
    27     IOutputPort OutputPort { get; }
     27    IOutputPort OutputPort { get; set; }
     28
     29    event EventHandler OutputPortChanged;
    2830  }
    2931
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputOutputPort.cs

    r11406 r11412  
    8282
    8383    protected void RegisterOutputInputPortEvents() {
    84       outputInputPort.ValueSent += OutputInputPort_ValueSent;
     84      if (outputInputPort != null) {
     85        outputInputPort.ValueSent += OutputInputPort_ValueSent;
     86      }
    8587    }
    8688    protected void DeregisterOutputInputPortEvents() {
    87       outputInputPort.ValueSent -= OutputInputPort_ValueSent;
     89      if (outputInputPort != null) {
     90        outputInputPort.ValueSent -= OutputInputPort_ValueSent;
     91      }
    8892    }
    8993    protected void OutputInputPort_ValueSent(object sender, OutputInputPortEventArgs<TIn, TOut> e) {
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputPort.cs

    r11409 r11412  
    4949    IOutputPort IInputPort.OutputPort {
    5050      get { return outputPort; }
     51      set {
     52        var val = value as IOutputPort<T>;
     53        if ((value != null) && (val == null))
     54          throw new InvalidOperationException(
     55            string.Format("Type mismatch. OutputPort is not a \"{0}\".",
     56                          typeof(IOutputPort<T>).GetPrettyName())
     57          );
     58        OutputPort = val;
     59      }
    5160    }
    5261
     
    7786
    7887    protected void RegisterOutputPortEvents() {
    79       outputPort.ValueChanged += OutputPort_ValueChanged;
    80      
     88      if (outputPort != null) {
     89        outputPort.ValueChanged += OutputPort_ValueChanged;
     90      }
    8191    }
    8292    protected void DeregisterOutputPortEvents() {
    83       outputPort.ValueChanged -= OutputPort_ValueChanged;
     93      if (outputPort != null) {
     94        outputPort.ValueChanged -= OutputPort_ValueChanged;
     95      }
    8496    }
    8597    protected void OutputPort_ValueChanged(object sender, EventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.