- Timestamp:
- 12/03/08 21:53:41 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Constraints
- Files:
-
- 8 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Constraints/HeuristicLab.Constraints.csproj
r852 r893 84 84 </Compile> 85 85 <Compile Include="IntBoundedConstraint.cs" /> 86 <Compile Include="FalseConstraintView.cs">87 <SubType>UserControl</SubType>88 </Compile>89 <Compile Include="FalseConstraintView.Designer.cs">90 <DependentUpon>FalseConstraintView.cs</DependentUpon>91 </Compile>92 86 <Compile Include="IntBoundedConstraintView.cs"> 93 87 <SubType>UserControl</SubType> … … 125 119 <DependentUpon>OrConstraintView.cs</DependentUpon> 126 120 </Compile> 127 <Compile Include="FalseConstraint.cs" />128 121 <Compile Include="SubOperatorsConstraintAnalyser.cs" /> 129 122 <Compile Include="SubOperatorsTypeConstraint.cs" /> … … 134 127 <DependentUpon>SubOperatorsTypeConstraintView.cs</DependentUpon> 135 128 </Compile> 136 <Compile Include="TrueConstraint.cs" />137 129 <Compile Include="HeuristicLabConstraintsPlugin.cs" /> 138 130 <Compile Include="Properties\AssemblyInfo.cs" /> 139 <Compile Include="TrueConstraintView.cs">140 <SubType>UserControl</SubType>141 </Compile>142 <Compile Include="TrueConstraintView.Designer.cs">143 <DependentUpon>TrueConstraintView.cs</DependentUpon>144 </Compile>145 131 <Compile Include="VariableComparisonConstraint.cs" /> 146 132 <Compile Include="VariableComparisonConstraintView.cs"> … … 182 168 <DependentUpon>DoubleBoundedConstraintView.cs</DependentUpon> 183 169 </EmbeddedResource> 184 <EmbeddedResource Include="FalseConstraintView.resx">185 <SubType>Designer</SubType>186 <DependentUpon>FalseConstraintView.cs</DependentUpon>187 </EmbeddedResource>188 170 <EmbeddedResource Include="IntBoundedConstraintView.resx"> 189 171 <SubType>Designer</SubType> … … 209 191 <DependentUpon>SubOperatorsTypeConstraintView.cs</DependentUpon> 210 192 <SubType>Designer</SubType> 211 </EmbeddedResource>212 <EmbeddedResource Include="TrueConstraintView.resx">213 <SubType>Designer</SubType>214 <DependentUpon>TrueConstraintView.cs</DependentUpon>215 193 </EmbeddedResource> 216 194 <EmbeddedResource Include="VariableComparisonConstraintView.resx"> -
trunk/sources/HeuristicLab.Constraints/NotConstraint.cs
r764 r893 44 44 public NotConstraint() 45 45 : base() { 46 subConstraint = new FalseConstraint();47 46 } 48 47 49 48 public override bool Check(IItem data) { 50 return !subConstraint.Check(data);49 return (subConstraint == null) || (!subConstraint.Check(data)); 51 50 } 52 51 … … 58 57 NotConstraint clone = new NotConstraint(); 59 58 clonedObjects.Add(Guid, clone); 60 clone.SubConstraint = (ConstraintBase)SubConstraint.Clone(); 59 if (subConstraint != null) 60 clone.SubConstraint = (ConstraintBase)SubConstraint.Clone(); 61 61 return clone; 62 62 } … … 65 65 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 66 66 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 67 XmlNode sub = PersistenceManager.Persist("SubConstraint", SubConstraint, document, persistedObjects); 68 node.AppendChild(sub); 67 if (subConstraint != null) { 68 XmlNode sub = PersistenceManager.Persist("SubConstraint", SubConstraint, document, persistedObjects); 69 node.AppendChild(sub); 70 } 69 71 return node; 70 72 } … … 72 74 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 73 75 base.Populate(node, restoredObjects); 74 subConstraint = (ConstraintBase)PersistenceManager.Restore(node.SelectSingleNode("SubConstraint"), restoredObjects); 76 XmlNode subNode = node.SelectSingleNode("SubConstraint"); 77 if(subNode!=null) 78 subConstraint = (ConstraintBase)PersistenceManager.Restore(subNode, restoredObjects); 75 79 } 76 80 #endregion -
trunk/sources/HeuristicLab.Constraints/NotConstraintView.cs
r2 r893 99 99 NotConstraint.SubConstraint = (ConstraintBase)Activator.CreateInstance(itemTypes[subConstraintComboBox.SelectedIndex]); 100 100 } catch (Exception) { 101 NotConstraint.SubConstraint = n ew FalseConstraint();101 NotConstraint.SubConstraint = null; 102 102 } 103 103 }
Note: See TracChangeset
for help on using the changeset viewer.