Forum Discussion
hkim5
Staff
I'm thinking that this may be extremely useful for CEF frameworks just because of the depth of objects typically embedded within those applications. But I'm not sure if that would be considered "complex" to a point where this is "needed" but I would think this would still be helpful.
BenoitB
4 years agoCommunity Hero
hkim5 i use it thoroughly in a complex WPF application and it save me a lot 😉
Another side effect of using it is that is a little quicker than the sequential call of findChildEx()
Here a simplified version without debug level and isolated from my framework :
function findContainer(ParentObject = null, Props = null, Values = null, Depth = 4) {
// Vérification des paramètres obligatoires
if ((ParentObject == null) || (Props == null) || (Values == null))
return null;
var objectfind = ParentObject;
let currentProps;
let currentValues;
let currentDepth;
try {
for (let i=0;i<Props.length;i++) {
currentProps = Props[i].split('|');
currentValues = new Array();
currentDepth = typeof Depth == 'number' ? Depth : Depth[i];
for (let j=0;j<currentProps.length;j++) {
currentValues.push(Values.shift());
}
objectfind = objectfind.FindChildEx(currentProps, currentValues, currentDepth, true, 5000);
if ((typeof objectfind == 'undefined') || ((objectfind != null) && (!objectfind.Exists)))
break;
}
}
catch (e) {
objectfind = null;
}
finally {
// Ne renvoyer que "null" sur non trouvé ou erreur
if ((typeof objectfind == 'undefined') || ((objectfind != null) && (!objectfind.Exists)))
objectfind = null;
return objectfind;
}
}
Related Content
- 4 years ago
- 2 years ago
- 8 years ago
- 12 years ago
Recent Discussions
- 2 hours ago
- 10 hours ago