/// <summary> /// Initializes a new instance of the <see cref="TreeItemConditionForeignKey"/> class. /// </summary> /// <param name="fieldName"> /// Name of the field. /// </param> /// <param name="foreignTable"> /// The foreign table. /// </param> /// <param name="foreignField"> /// The foreign field. /// </param> public TreeItemConditionForeignKey(string fieldName, string foreignTable, string foreignField) { this.fieldName = fieldName; this.foreignTable = foreignTable; this.foreignField = foreignField; this.foreignCondition = null; }
/// <summary> /// Adds the foreign table condition. /// </summary> /// <param name="condition"> /// The condition. /// </param> /// <returns> /// The <see cref="TreeItemCondition"/>. /// </returns> public TreeItemCondition AddForeignTableCondition(TreeItemCondition condition) { this.foreignCondition = this.foreignCondition == null ? condition : new TreeItemConditionRelation("AND", this.foreignCondition, condition); return(this.foreignCondition); }
/// <summary> /// Initializes a new instance of the <see cref="TreeItemConditionRelation"/> class. /// </summary> /// <param name="relation"> /// The relation. /// </param> /// <param name="single"> /// The single. /// </param> public TreeItemConditionRelation(string relation, TreeItemCondition single) { this.subItems = new List <TreeItemCondition>(1) { single }; this.relation = relation; }
/// <summary> /// Initializes a new instance of the <see cref="TreeItemConditionRelation"/> class. /// </summary> /// <param name="relation"> /// The relation. /// </param> /// <param name="left"> /// The left. /// </param> /// <param name="right"> /// The right. /// </param> public TreeItemConditionRelation(string relation, TreeItemCondition left, TreeItemCondition right) { this.subItems = new List <TreeItemCondition>(2) { left, right }; this.relation = relation; }
/// <summary> /// Adds the sub condition. /// </summary> /// <param name="condition"> /// The condition. /// </param> public void AddSubCondition(TreeItemCondition condition) { if (this.subItems == null) { this.subItems = new List <TreeItemCondition>(); } this.subItems.Add(condition); }