src/FingersDance.Data/Annotation.cs
changeset 69 a4c44555f205
parent 55 1ec0ef228158
child 150 569925b65604
--- a/src/FingersDance.Data/Annotation.cs	Wed Sep 16 09:07:27 2009 +0200
+++ b/src/FingersDance.Data/Annotation.cs	Wed Sep 16 15:36:08 2009 +0200
@@ -5,21 +5,21 @@
 
 namespace FingersDance.Data
 {
-    class AnnotationAddedEventArg : EventArgs
+    public class AnnotationAddedEventArg : EventArgs
     {
         private float _tcBegin;
         private float _dur;  
         private String _gestureType;
 
-        public float tcBegin
+        public float TcBegin
         {
             get { return this._tcBegin; }
         }
-        public float dur
+        public float Dur
         {  
             get { return this._dur; }
         }  
-        public String gestureType
+        public String GestureType
         {  
             get { return this._gestureType; }
         }
@@ -34,22 +34,53 @@
 
     }
 
-    class Annotation
+    public class Annotation
     {
-        private float tcBegin;
-        private float dur;
-        private string gestureType;
+        private float _tcBegin;
+        private float _dur;
+        private string _gestureType;
 
-        public event EventHandler<AnnotationAddedEventArg> AnnotationAdded;
+        //public event EventHandler<AnnotationAddedEventArg> AnnotationAdded;
 
         public Annotation(float tcBeginPar, float durPar, string gesturePar)
         {
-            this.tcBegin = tcBeginPar;
-            this.dur = durPar;
-            this.gestureType = gesturePar;
+            this._tcBegin = tcBeginPar;
+            this._dur = durPar;
+            this._gestureType = gesturePar;
+
+            //AnnotationAdded(this, new AnnotationAddedEventArg(_tcBegin, _dur, _gestureType));
+
+        }
 
-            AnnotationAdded(this, new AnnotationAddedEventArg(tcBegin, dur, gestureType));
-
+        public float TcBegin
+        {
+            get { return _tcBegin; }
+            set
+            {
+                if (value == _tcBegin || float.IsNaN(value))
+                    return;
+                _tcBegin = value;
+            }
+        }
+        public float Dur
+        {
+            get { return _dur; }
+            set
+            {
+                if (value == _dur || float.IsNaN(value))
+                    return;
+                _dur = value;
+            }
+        }
+        public String GestureType
+        {
+            get { return _gestureType; }
+            set
+            {
+                if (value == _gestureType || String.IsNullOrEmpty(value))
+                    return;
+                _gestureType = value;
+            }
         }
         
     }