/// <summary> /// Appends the INamable which match the name provided in retVal /// </summary> /// <param name="name"></param> /// <param name="retVal"></param> public void Find(string name, List <Utils.INamable> retVal) { if (!BuildingDeclaredElements) { try { BuildingDeclaredElements = true; Values.StructureValue structureValue = Value as Values.StructureValue; if (structureValue != null) { structureValue.Find(name, retVal); } // Dereference of an empty value holds the empty value Values.EmptyValue emptyValue = Value as Values.EmptyValue; if (emptyValue != null) { retVal.Add(emptyValue); } } finally { BuildingDeclaredElements = false; } } }
/// <summary> /// Creates a valid right side IValue, according to the target variable (left side) /// </summary> /// <param name="variable">The target variable</param> /// <param name="duplicate">Indicates that a duplication of the variable should be performed</param> /// <returns></returns> public override Values.IValue RightSide(Variables.IVariable variable, bool duplicate) { ListValue retVal = this; // Complete the list with empty values Types.Collection collectionType = variable.Type as Types.Collection; if (collectionType != null) { Values.EmptyValue emptyValue = EFSSystem.EmptyValue; while (retVal.Val.Count < collectionType.getMaxSize()) { retVal.Val.Add(emptyValue); } } retVal.Enclosing = variable; return(retVal); }