From c09a915147b3b30dcfff68366301e509cc7c47f1 Mon Sep 17 00:00:00 2001
From: "francois.grand" <francois.grand@irstea.fr>
Date: Tue, 26 Jun 2018 15:27:25 +0200
Subject: [PATCH] =?UTF-8?q?=20#45=20ParamValues=20:=20ajout=20de=20la=20pr?=
 =?UTF-8?q?opri=C3=A9t=C3=A9=20hasMultipleValues?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/param/param-values.ts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/param/param-values.ts b/src/param/param-values.ts
index 2317d3a9..f8e46ff9 100644
--- a/src/param/param-values.ts
+++ b/src/param/param-values.ts
@@ -278,6 +278,20 @@ export class ParamValues implements INubReference, IterableValues {
         return this._currentValue.value;
     }
 
+    /**
+     * @return true si la config actuelle génère plusieurs valeurs
+     */
+    public get hasMultipleValues(): boolean {
+        const it = this.getValuesIterator();
+        let n = 0;
+        for (const v of it) {
+            n++;
+            if (n > 1)
+                break;
+        }
+        return n > 1;
+    }
+
     // interface INubReference
 
     public defineReference(target: IReferencedNub, desc: string) {
-- 
GitLab