src/FingersDance.Data/Annotation.cs
changeset 69 a4c44555f205
parent 55 1ec0ef228158
child 150 569925b65604
equal deleted inserted replaced
68:5f547156bda6 69:a4c44555f205
     3 using System.Linq;
     3 using System.Linq;
     4 using System.Text;
     4 using System.Text;
     5 
     5 
     6 namespace FingersDance.Data
     6 namespace FingersDance.Data
     7 {
     7 {
     8     class AnnotationAddedEventArg : EventArgs
     8     public class AnnotationAddedEventArg : EventArgs
     9     {
     9     {
    10         private float _tcBegin;
    10         private float _tcBegin;
    11         private float _dur;  
    11         private float _dur;  
    12         private String _gestureType;
    12         private String _gestureType;
    13 
    13 
    14         public float tcBegin
    14         public float TcBegin
    15         {
    15         {
    16             get { return this._tcBegin; }
    16             get { return this._tcBegin; }
    17         }
    17         }
    18         public float dur
    18         public float Dur
    19         {  
    19         {  
    20             get { return this._dur; }
    20             get { return this._dur; }
    21         }  
    21         }  
    22         public String gestureType
    22         public String GestureType
    23         {  
    23         {  
    24             get { return this._gestureType; }
    24             get { return this._gestureType; }
    25         }
    25         }
    26 
    26 
    27         public AnnotationAddedEventArg(float tcBegin, float dur, String gestureType) {
    27         public AnnotationAddedEventArg(float tcBegin, float dur, String gestureType) {
    32         
    32         
    33         }
    33         }
    34 
    34 
    35     }
    35     }
    36 
    36 
    37     class Annotation
    37     public class Annotation
    38     {
    38     {
    39         private float tcBegin;
    39         private float _tcBegin;
    40         private float dur;
    40         private float _dur;
    41         private string gestureType;
    41         private string _gestureType;
    42 
    42 
    43         public event EventHandler<AnnotationAddedEventArg> AnnotationAdded;
    43         //public event EventHandler<AnnotationAddedEventArg> AnnotationAdded;
    44 
    44 
    45         public Annotation(float tcBeginPar, float durPar, string gesturePar)
    45         public Annotation(float tcBeginPar, float durPar, string gesturePar)
    46         {
    46         {
    47             this.tcBegin = tcBeginPar;
    47             this._tcBegin = tcBeginPar;
    48             this.dur = durPar;
    48             this._dur = durPar;
    49             this.gestureType = gesturePar;
    49             this._gestureType = gesturePar;
    50 
    50 
    51             AnnotationAdded(this, new AnnotationAddedEventArg(tcBegin, dur, gestureType));
    51             //AnnotationAdded(this, new AnnotationAddedEventArg(_tcBegin, _dur, _gestureType));
    52 
    52 
       
    53         }
       
    54 
       
    55         public float TcBegin
       
    56         {
       
    57             get { return _tcBegin; }
       
    58             set
       
    59             {
       
    60                 if (value == _tcBegin || float.IsNaN(value))
       
    61                     return;
       
    62                 _tcBegin = value;
       
    63             }
       
    64         }
       
    65         public float Dur
       
    66         {
       
    67             get { return _dur; }
       
    68             set
       
    69             {
       
    70                 if (value == _dur || float.IsNaN(value))
       
    71                     return;
       
    72                 _dur = value;
       
    73             }
       
    74         }
       
    75         public String GestureType
       
    76         {
       
    77             get { return _gestureType; }
       
    78             set
       
    79             {
       
    80                 if (value == _gestureType || String.IsNullOrEmpty(value))
       
    81                     return;
       
    82                 _gestureType = value;
       
    83             }
    53         }
    84         }
    54         
    85         
    55     }
    86     }
    56 
    87 
    57 }
    88 }