public Criterion( Criterion other ) { if( other == null ) throw new ArgumentNullException( "other" ); Type = other.Type; FromRank = other.FromRank; ToRank = other.ToRank; Condition = other.Condition; }
private void bOK_Click( object sender, EventArgs e ) { XDocument doc = new XDocument(); XElement root = new XElement( AutoRankManager.TagName ); foreach( TreeNode node in treeData.Nodes ) { ActionNode anode = (ActionNode)node; if( anode.FromRank == null || anode.ToRank == null ) continue; Criterion crit = new Criterion { FromRank = anode.FromRank, ToRank = anode.ToRank, Condition = ExportConditions( anode ) }; root.Add( crit.Serialize() ); } doc.Add( root ); doc.Save( Paths.AutoRankFileName ); Application.Exit(); }
public static void Add( Criterion criterion ) { if( criterion == null ) throw new ArgumentNullException( "criterion" ); Criteria.Add( criterion ); }