- Timestamp:
- 10/03/14 02:20:19 (10 years ago)
- 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 83 83 if (algorithm.Parameters.TryGetValue(port.Name, out param)) { 84 84 IValueParameter p = param as IValueParameter; 85 if ( p != null) {85 if ((p != null) && (port.Value != null)) { 86 86 p.Value = (IItem)port.Value; 87 87 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
r11406 r11412 48 48 </ItemGroup> 49 49 <ItemGroup> 50 <Compile Include="IVariablesNode.cs" /> 51 <Compile Include="VariablesNode.cs" /> 50 52 <Compile Include="EventArgs.cs" /> 51 53 <Compile Include="IInputOutputPort.cs" /> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IInputOutputPort.cs
r11406 r11412 26 26 public interface IInputOutputPort : IPort { 27 27 IOutputInputPort OutputInputPort { get; } 28 29 event EventHandler OutputInputPortChanged; 28 30 } 29 31 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IInputPort.cs
r11401 r11412 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using System; 23 using HeuristicLab.Core;24 24 25 25 namespace HeuristicLab.Optimization.Networks { 26 26 public interface IInputPort : IPort { 27 IOutputPort OutputPort { get; } 27 IOutputPort OutputPort { get; set; } 28 29 event EventHandler OutputPortChanged; 28 30 } 29 31 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputOutputPort.cs
r11406 r11412 82 82 83 83 protected void RegisterOutputInputPortEvents() { 84 outputInputPort.ValueSent += OutputInputPort_ValueSent; 84 if (outputInputPort != null) { 85 outputInputPort.ValueSent += OutputInputPort_ValueSent; 86 } 85 87 } 86 88 protected void DeregisterOutputInputPortEvents() { 87 outputInputPort.ValueSent -= OutputInputPort_ValueSent; 89 if (outputInputPort != null) { 90 outputInputPort.ValueSent -= OutputInputPort_ValueSent; 91 } 88 92 } 89 93 protected void OutputInputPort_ValueSent(object sender, OutputInputPortEventArgs<TIn, TOut> e) { -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputPort.cs
r11409 r11412 49 49 IOutputPort IInputPort.OutputPort { 50 50 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 } 51 60 } 52 61 … … 77 86 78 87 protected void RegisterOutputPortEvents() { 79 outputPort.ValueChanged += OutputPort_ValueChanged; 80 88 if (outputPort != null) { 89 outputPort.ValueChanged += OutputPort_ValueChanged; 90 } 81 91 } 82 92 protected void DeregisterOutputPortEvents() { 83 outputPort.ValueChanged -= OutputPort_ValueChanged; 93 if (outputPort != null) { 94 outputPort.ValueChanged -= OutputPort_ValueChanged; 95 } 84 96 } 85 97 protected void OutputPort_ValueChanged(object sender, EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.